Created
September 1, 2021 23:58
-
-
Save cameronelliott/cf96261fdb61d9da4075c44b10cc4aba to your computer and use it in GitHub Desktop.
nice go dockerfile starter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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