Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created August 12, 2019 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/87280aa9012c73932c6b521b832b89b3 to your computer and use it in GitHub Desktop.
Save miguelmota/87280aa9012c73932c6b521b832b89b3 to your computer and use it in GitHub Desktop.
Dockerfile golang with cgo
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