Created
September 14, 2019 11:05
-
-
Save cristaloleg/4ceeb3cecf2a64493242d4bbeb52627c to your computer and use it in GitHub Desktop.
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
# build stage | |
FROM golang:alpine AS builder | |
WORKDIR /go/src/github.com/foo/bar | |
COPY go.mod . | |
COPY go.sum . | |
RUN apk add --no-cache git | |
RUN go mod download | |
COPY . . | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -o front.exec cmd/main.go | |
# final stage | |
FROM scratch as prod | |
COPY --from=builder /go/src/github.com/foo/bar app.exec | |
LABEL Name=super-app Version=0.0.1 | |
EXPOSE 8081 | |
ENTRYPOINT ["./app.exec"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment