Skip to content

Instantly share code, notes, and snippets.

@fladago
Created September 30, 2021 17:06
Show Gist options
  • Save fladago/b585b346adb03c4ae26c76948737807b to your computer and use it in GitHub Desktop.
Save fladago/b585b346adb03c4ae26c76948737807b to your computer and use it in GitHub Desktop.
FROM golang:1.17.1-alpine3.14 AS build
WORKDIR /src/
COPY go.* /src/
RUN go mod download
COPY ./ /src/
RUN CGO_ENABLED=0 go build -o /bin/demo
FROM scratch
COPY --from=build /bin/demo /bin/demo
ENTRYPOINT [ "/bin/demo" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment