Skip to content

Instantly share code, notes, and snippets.

@starlightromero
Created July 19, 2021 19:46
Show Gist options
  • Select an option

  • Save starlightromero/7fc688338b53512c0c6512de525d5c75 to your computer and use it in GitHub Desktop.

Select an option

Save starlightromero/7fc688338b53512c0c6512de525d5c75 to your computer and use it in GitHub Desktop.
Golang Dockerfile.distroless
FROM golang:1.16-alpine as build
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build .
FROM gcr.io/distroless/static-debian10:nonroot
COPY --from=build /app/geolocation /usr/bin/geolocation
ENTRYPOINT ["/usr/bin/geolocation"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment