Skip to content

Instantly share code, notes, and snippets.

@jonstacks
Created November 10, 2019 22:02
Show Gist options
  • Save jonstacks/73e814ce9dd3f8fd8b075338d620c34a to your computer and use it in GitHub Desktop.
Save jonstacks/73e814ce9dd3f8fd8b075338d620c34a to your computer and use it in GitHub Desktop.
Golang Example of docker multi-stage build
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