mirror of
https://github.com/halverneus/static-file-server.git
synced 2024-11-12 21:45:29 +00:00
Merge pull request #41 from fhemberger/patch-1
Dockerfile: Don't run as `root`
This commit is contained in:
commit
e8e967c49d
@ -16,6 +16,8 @@ COPY . .
|
||||
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
|
||||
|
||||
################################################################################
|
||||
## DEPLOYMENT CONTAINER
|
||||
################################################################################
|
||||
@ -23,6 +25,9 @@ FROM scratch
|
||||
|
||||
EXPOSE 8080
|
||||
COPY --from=builder /serve /
|
||||
COPY --from=builder /etc/passwd /etc/passwd
|
||||
|
||||
USER static
|
||||
ENTRYPOINT ["/serve"]
|
||||
CMD []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user