Skip to content

Instantly share code, notes, and snippets.

@olafkotur
Last active January 29, 2020 20:45
Show Gist options
  • Save olafkotur/1476a2fd0a032327728c6e37310057db to your computer and use it in GitHub Desktop.
Save olafkotur/1476a2fd0a032327728c6e37310057db to your computer and use it in GitHub Desktop.
Docker multistaging dockerfile example
# Stage 1 - building
FROM golang:1.13-alpine3.10 as build
WORKDIR /go/src/app
COPY . .
RUN go build
# Stage 2 - optimised container
FROM alpine:3.10
COPY --from=build /go/src/app/main .
EXPOSE 8080
CMD ./main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment