-
-
Save jrockway/cceef8bb5dcef62743f8bcbc044cd2ad to your computer and use it in GitHub Desktop.
Go image
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:alpine AS build | |
RUN apk add git bzr gcc musl-dev | |
WORKDIR /whatever/ | |
COPY go.mod go.sum ./ | |
ARG GOPROXY | |
RUN go mod download | |
COPY . . | |
ARG VERSION | |
RUN go install -ldflags "-X <internal package>.Version=$VERSION" -v ./your/app | |
FROM alpine:latest | |
RUN apk add ca-certificates tzdata | |
WORKDIR / | |
COPY --from=build /go/bin/app /go/bin/app | |
CMD ["/go/bin/app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment