Last active
November 20, 2020 00:42
-
-
Save antklim/e36f229709862508bd7734f4ebb5a91b to your computer and use it in GitHub Desktop.
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
| # 1. Build | |
| FROM golang:alpine as builder | |
| ENV GO111MODULE=on \ | |
| CGO_ENABLED=0 \ | |
| GOOS=linux \ | |
| GOARCH=amd64 | |
| WORKDIR /build | |
| COPY go.mod . | |
| COPY go.sum . | |
| RUN go mod download | |
| COPY . . | |
| RUN go build -o . ./... | |
| WORKDIR /dist | |
| RUN cp /build/calc . | |
| # 2. Run | |
| FROM gcr.io/distroless/base | |
| COPY --from=builder /dist/calc / | |
| # Command to run | |
| ENTRYPOINT ["/calc"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment