Created
October 28, 2019 23:24
-
-
Save hashamali/7a0284a6abe1fc267eaf7d01f757ef42 to your computer and use it in GitHub Desktop.
Dockerfile for Go Builds
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
# Build | |
FROM golang:1.11-alpine | |
RUN apk add git | |
ADD . $GOPATH/src/myproject | |
WORKDIR $GOPATH/src/myproject | |
RUN go get myproject | |
RUN go install myproject | |
# Run | |
FROM alpine:latest | |
COPY --from=0 /go/bin/myproject . | |
ENV PORT 8080 | |
CMD ["./myproject"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment