Created
November 10, 2019 22:02
-
-
Save jonstacks/73e814ce9dd3f8fd8b075338d620c34a to your computer and use it in GitHub Desktop.
Golang Example of docker multi-stage build
This file contains hidden or 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.13-alpine as builder | |
WORKDIR /my-proj | |
ADD . . | |
RUN CGO_ENABLED=0 go install ./cmd/my-cmd/... | |
FROM alpine:latest | |
COPY --from=builder /go/bin/my-cmd /usr/local/bin/my-cmd | |
ENTRYPOINT ["/usr/local/bin/my-cmd"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment