Skip to content

Instantly share code, notes, and snippets.

@viettranx
Created September 29, 2018 10:36
Show Gist options
  • Save viettranx/a6463a9e68b62f77f71731e346f16145 to your computer and use it in GitHub Desktop.
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
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