Skip to content

Instantly share code, notes, and snippets.

@jrockway jrockway/Dockerfile Secret
Created Feb 26, 2019

Embed
What would you like to do?
Go image
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
You can’t perform that action at this time.