Skip to content

Instantly share code, notes, and snippets.

@cameronelliott
Created September 1, 2021 23:58
Show Gist options
  • Save cameronelliott/cf96261fdb61d9da4075c44b10cc4aba to your computer and use it in GitHub Desktop.
Save cameronelliott/cf96261fdb61d9da4075c44b10cc4aba to your computer and use it in GitHub Desktop.
nice go dockerfile starter
# builder image
FROM golang:1.13-alpine3.11 as builder
RUN mkdir /build
ADD *.go /build/
WORKDIR /build
RUN CGO_ENABLED=0 GOOS=linux go build -a -o golang-memtest .
# generate clean, final image for end users
FROM alpine:3.11.3
COPY --from=builder /build/golang-memtest .
# executable
ENTRYPOINT [ "./golang-memtest" ]
# arguments that can be overridden
CMD [ "3", "300" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment