Created
April 28, 2020 14:15
-
-
Save yk-sgr/557010251723ebdb358ef5109839445b to your computer and use it in GitHub Desktop.
Go Multistage Docker
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 | |
WORKDIR /app | |
ADD . . | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -o server cmd/server/main.go | |
FROM alpine:latest | |
RUN apk --no-cache add ca-certificates | |
WORKDIR /app | |
COPY --from=builder /app/server . | |
CMD ["./server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment