Skip to content

Instantly share code, notes, and snippets.

@treeder
Last active August 12, 2019 21:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save treeder/2ce2f809bd491e1409720fc0b708ef06 to your computer and use it in GitHub Desktop.
Save treeder/2ce2f809bd491e1409720fc0b708ef06 to your computer and use it in GitHub Desktop.
multi-stage build
# build stage
FROM golang:alpine AS build-env
RUN apk --no-cache add build-base git bzr mercurial gcc
ADD . /src
RUN cd /src && go build -o goapp
# final stage
FROM alpine
WORKDIR /app
COPY --from=build-env /src/goapp /app/
ENTRYPOINT ./goapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment