Skip to content

Instantly share code, notes, and snippets.

@jldeen

jldeen/Dockerfile Secret

Created Apr 30, 2020
Embed
What would you like to do?
Debian cgo Example Dockerfile: don't use this in production
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
You can’t perform that action at this time.