Golang minimal Dockerfile image
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
FROM golang:1.14.3-alpine3.11 AS build | |
RUN apk add --no-cache git | |
RUN go get github.com/docker/docker/api/types | |
RUN go get github.com/docker/docker/client | |
RUN apk del git | |
WORKDIR /go/src/myapp | |
COPY . . | |
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/myapp . | |
FROM scratch | |
COPY --from=build /bin/myapp /bin/myapp | |
ENTRYPOINT ["/bin/myapp"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment