Skip to content

Instantly share code, notes, and snippets.

@asolera

asolera/Dockerfile

Created May 19, 2020
Embed
What would you like to do?
Golang minimal Dockerfile image
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
You can’t perform that action at this time.