Created
August 12, 2019 05:58
-
-
Save miguelmota/87280aa9012c73932c6b521b832b89b3 to your computer and use it in GitHub Desktop.
Dockerfile golang with cgo
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.12rc1-alpine3.9 | |
RUN apk --no-cache add gcc musl-dev | |
COPY . /go/src/github.com/myorg/myapp | |
WORKDIR /go/src/github.com/myorg/myapp | |
RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o myapp cmd/myapp/main.go | |
CMD ["./myapp"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment