Created
July 29, 2024 23:33
-
-
Save rob-sokolowski/ff6481548fdd52ce454edc94f8df7577 to your computer and use it in GitHub Desktop.
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:1.22 as build | |
USER root | |
WORKDIR /go/src/app | |
COPY . . | |
RUN go mod download | |
RUN CGO_ENABLED=1 go build -v -o /app . | |
# Now copy it into our base image. | |
# | |
# Note: I moved off the official "distroless" image, due to this issue: https://github.com/GoogleContainerTools/distroless/issues/1342 | |
# I have no clue of the differences, but this works *shrug* | |
FROM cgr.dev/chainguard/glibc-dynamic | |
USER root | |
WORKDIR / | |
COPY --from=build /app /app | |
COPY --from=build /go/src/app/.private /private | |
CMD ["/app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment