Created
September 29, 2018 10:36
-
-
Save viettranx/a6463a9e68b62f77f71731e346f16145 to your computer and use it in GitHub Desktop.
A Dockerfile (multi stage) to build and run a very simple web application
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
FROM golang:latest as builder | |
RUN mkdir /app | |
ADD . /app/ | |
WORKDIR /app | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o demoApp . | |
FROM alpine:latest | |
WORKDIR /app/ | |
COPY --from=builder /app . | |
CMD ["/app/demoApp"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment