Skip to content

Commit aba2be8

Browse files
authored
docker: use scratch for runtime image (#77)
1 parent 553a8c1 commit aba2be8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ WORKDIR /build
44
COPY go.mod go.sum ./
55
RUN go mod download
66
COPY ./ ./
7+
ENV CGO_ENABLED=0
78
RUN go build -ldflags "-w -s" -trimpath -o speedtest .
89

9-
FROM alpine:3.16
10-
RUN apk add --no-cache ca-certificates
10+
FROM scratch
1111
WORKDIR /app
1212
COPY --from=build_base /build/speedtest ./
1313
COPY settings.toml ./
1414

15-
USER nobody
1615
EXPOSE 8989
1716

1817
CMD ["./speedtest"]

0 commit comments

Comments
 (0)