Created
July 2, 2019 07:34
-
-
Save jittuu/52e41234b57cc588a767435ee769e049 to your computer and use it in GitHub Desktop.
Dockerfile for go web api
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:1.12 as builder | |
ADD . /app/api | |
WORKDIR /app/api | |
RUN go mod download | |
RUN CGO_ENABLED=0 GOOS=linux go build -v -o api | |
FROM alpine | |
RUN apk --no-cache add ca-certificates | |
COPY --from=builder /app/api/api /api | |
CMD ["/api"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment