Last active
September 25, 2019 09:45
-
-
Save max-weis/10ea322d9a334835ee3797ba22f59884 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# build stage | |
FROM golang:1.13-alpine as build | |
WORKDIR $GOPATH/app/ | |
RUN apk add git | |
# copy and download dependencies | |
COPY go.* . | |
RUN go mod download | |
#compile app | |
COPY . . | |
RUN CGO_ENABLED=0 GOOS=linux go build -o main | |
#resulting app | |
FROM scratch as final | |
COPY --from=build go/app/main /app/ | |
WORKDIR /app | |
ENTRYPOINT [ "./main" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment