Created
December 15, 2019 08:25
-
-
Save DonBattery/11b7a04c9ecde487fd6fb49b4d6964c5 to your computer and use it in GitHub Desktop.
Multistage Golang Dockerfile
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 AS builder | |
WORKDIR /app | |
COPY . . | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o my-app . | |
FROM alpine:latest | |
RUN apk --no-cache add ca-certificates | |
WORKDIR /app | |
COPY --from=builder /app/my-app . | |
COPY my-app-config.yaml . | |
CMD ["./my-app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment