Last active
January 29, 2020 20:45
-
-
Save olafkotur/1476a2fd0a032327728c6e37310057db to your computer and use it in GitHub Desktop.
Docker multistaging dockerfile example
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
# 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