Created
December 23, 2023 21:10
-
-
Save gregyjames/b4835ccfe6f5a3f98b11cdfc9f89f23b to your computer and use it in GitHub Desktop.
Minimal size docker file for go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:latest as golang | |
WORKDIR /app | |
COPY . . | |
RUN go mod download | |
RUN go mod verify | |
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server . | |
FROM gcr.io/distroless/static-debian11 | |
COPY --from=golang /server . | |
EXPOSE 8080 | |
CMD ["/server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment