Added setcap that requires DOCKER_BUILDKIT to build properly.

This commit is contained in:
Jeromy Streets 2020-02-05 10:25:39 -08:00
parent 404e6a8349
commit 81a38cac75

View File

@ -17,6 +17,7 @@ RUN go test -cover ./...
RUN CGO_ENABLED=0 go build -a -tags netgo -installsuffix netgo -ldflags "-X github.com/halverneus/static-file-server/cli/version.version=${VERSION}" -o /serve /build/bin/serve
RUN adduser --system --no-create-home --uid 1000 --shell /usr/sbin/nologin static
RUN setcap cap_net_bind_service=+ep /serve
################################################################################
## DEPLOYMENT CONTAINER
@ -33,8 +34,8 @@ CMD []
# Metadata
LABEL life.apets.vendor="Halverneus" \
life.apets.url="https://github.com/halverneus/static-file-server" \
life.apets.name="Static File Server" \
life.apets.description="A tiny static file server" \
life.apets.version="v1.7.1" \
life.apets.schema-version="1.0"
life.apets.url="https://github.com/halverneus/static-file-server" \
life.apets.name="Static File Server" \
life.apets.description="A tiny static file server" \
life.apets.version="v1.7.1" \
life.apets.schema-version="1.0"