Skip to content

Instantly share code, notes, and snippets.

@billglover
Created November 1, 2018 10:38
Show Gist options
  • Save billglover/b7408b9262e3f70af1b2afcbf2063a64 to your computer and use it in GitHub Desktop.
Save billglover/b7408b9262e3f70af1b2afcbf2063a64 to your computer and use it in GitHub Desktop.
FROM golang:1.11.1-alpine as build
RUN apk add --update --no-cache ca-certificates git
RUN mkdir /app
WORKDIR /app
COPY . .
RUN GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s" -o /go/bin/app
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /go/bin/app /go/bin/app
ENTRYPOINT ["/go/bin/app"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment