-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (40 loc) · 1.42 KB
/
Dockerfile
File metadata and controls
48 lines (40 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# NOTE: the platform is pinned to linux/amd64 because builds often happen on
# Apple Silicon, but the resulting image needs to run in x86 Linux batch/HPC
# environments.
ARG TARGETPLATFORM=linux/amd64
FROM --platform=$TARGETPLATFORM golang:1.24-alpine AS build
RUN apk add --no-cache gcc musl-dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
# overwrite this at build time
ARG Version=foo-docker-version
COPY *.go ./
COPY cmd ./cmd
COPY fastq ./fastq
COPY fastqio ./fastqio
COPY sort ./sort
RUN go test ./...
RUN go build -trimpath -ldflags="-X 'squish.Version=$Version'" -o /squish ./cmd/squish
##
## Deploy
##
# NOTE: had issues with alpine on AWS Batch, so use Ubuntu for runtime.
FROM --platform=$TARGETPLATFORM ubuntu:22.04
# Runtime packages:
# - pigz: parallel gzip tooling for downstream shell workflows.
# - graphviz: provides dot, required by `go tool pprof -pdf`.
# - ca-certificates/procps: small operational utilities useful in batch systems.
# - golang-go: provides `go tool pprof` for PDF profile generation. Nextflow is
# intentionally not installed here because Nextflow runs the container.
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
graphviz \
golang-go \
pigz \
procps \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /squish /usr/local/bin/squish
RUN which squish
RUN squish -h || true