Created
January 28, 2021 05:28
-
-
Save bscott/88c42cc2c4135ab8ba83a391f697a024 to your computer and use it in GitHub Desktop.
Go Dockerfile
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.15-alpine AS build | |
RUN apk add --no-cache git | |
WORKDIR /go/src/project | |
COPY . /go/src/project | |
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/index <PROJECT PATH> | |
FROM scratch | |
COPY --from=build /bin/index /bin/index | |
EXPOSE 8080 | |
CMD ["/bin/index"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment