You've already forked speedtest-go
docker: use scratch for runtime image (#77)
This commit is contained in:
+2
-3
@@ -4,15 +4,14 @@ WORKDIR /build
|
|||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
|
ENV CGO_ENABLED=0
|
||||||
RUN go build -ldflags "-w -s" -trimpath -o speedtest .
|
RUN go build -ldflags "-w -s" -trimpath -o speedtest .
|
||||||
|
|
||||||
FROM alpine:3.16
|
FROM scratch
|
||||||
RUN apk add --no-cache ca-certificates
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build_base /build/speedtest ./
|
COPY --from=build_base /build/speedtest ./
|
||||||
COPY settings.toml ./
|
COPY settings.toml ./
|
||||||
|
|
||||||
USER nobody
|
|
||||||
EXPOSE 8989
|
EXPOSE 8989
|
||||||
|
|
||||||
CMD ["./speedtest"]
|
CMD ["./speedtest"]
|
||||||
|
|||||||
Reference in New Issue
Block a user