Skip to content

Instantly share code, notes, and snippets.

@jeffotoni
Created July 29, 2020 22:35
Show Gist options
  • Save jeffotoni/e28325fffe46ec00d1fde69f75bd1f28 to your computer and use it in GitHub Desktop.
Save jeffotoni/e28325fffe46ec00d1fde69f75bd1f28 to your computer and use it in GitHub Desktop.
FROM golang:1.14 as builder
WORKDIR /go/src/upnid-api
COPY . .
ENV GO111MODULE=on
RUN GOSUMDB=off CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o upnid-api main.go
RUN cp upnid-api /go/bin/upnid-api
# Now copy it into our base image.
FROM gcr.io/distroless/base
COPY --from=builder /go/bin/upnid-api /
CMD ["/upnid-api"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment