mirror of
https://github.com/schollz/croc.git
synced 2024-11-24 16:23:47 +03:00
968950f783
See https://americanexpress.io/do-not-run-dockerized-applications-as-root/ and https://engineering.bitnami.com/articles/why-non-root-containers-are-important-for-security.html
17 lines
327 B
Docker
17 lines
327 B
Docker
FROM golang:1.16-alpine as builder
|
|
RUN apk add --no-cache git
|
|
WORKDIR /go/croc
|
|
COPY . .
|
|
RUN go build -v -ldflags="-s -w"
|
|
|
|
FROM alpine:latest
|
|
EXPOSE 9009
|
|
EXPOSE 9010
|
|
EXPOSE 9011
|
|
EXPOSE 9012
|
|
EXPOSE 9013
|
|
COPY --from=builder /go/croc/croc /go/croc/croc-entrypoint.sh /
|
|
USER nobody
|
|
ENTRYPOINT ["/croc-entrypoint.sh"]
|
|
CMD ["relay"]
|