Last active
February 11, 2018 11:32
-
-
Save kmckelvin/253bb83d1dde4d178b41693578ec03a5 to your computer and use it in GitHub Desktop.
Multiple base images when building
This file contains hidden or 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.9.4 AS build | |
WORKDIR /go/src/github.com/kmckelvin/app | |
COPY . . | |
RUN go test ./... | |
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o /app main.go | |
FROM scratch | |
COPY --from=build /app / | |
ENV PORT 80 | |
CMD ["/app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment