/Dockerfile Secret
Created
April 30, 2020 20:44
Debian cgo Example Dockerfile: don't use this in production
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.14.2-alpine3.11 as builder | |
RUN apk update && apk add --no-cache git | |
WORKDIR $GOPATH/src/croc-hunter/ | |
ENV GOPATH /go | |
COPY croc-hunter.go /go/src/croc-hunter/ | |
COPY static/ static/ | |
RUN go get -d -v | |
ENV CGO_ENABLED=0 | |
RUN go build -o /go/bin/croc-hunter | |
FROM golang:1.14.2 AS final | |
WORKDIR /app | |
COPY static/ static/ | |
COPY --from=builder /go/bin/croc-hunter /app/croc-hunter | |
RUN setcap 'cap_net_bind_service=+ep' /app/croc-hunter | |
USER 1000 | |
EXPOSE ${PORT} | |
CMD ["/app/croc-hunter"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment