Created
March 20, 2020 10:57
-
-
Save uurtech/0a21a759c382f8639c0cd3df32d7a823 to your computer and use it in GitHub Desktop.
Golang Docker Multistage builder
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 | |
COPY main.go main.go | |
COPY controllers.go controllers.go | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . | |
FROM scratch | |
MAINTAINER Uğur Kazdal girisiyorum@gmail.com | |
COPY --from=0 /go/main . | |
CMD ["./main"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment