Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit 9a3ae14

Browse files
committed
use uid and gid instead of names
1 parent 5f0db87 commit 9a3ae14

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Builder image used to create a non-root user and to pick the SSL CA certs from
1616
FROM alpine:3.18.0 as builder
1717
RUN apk --update add ca-certificates
18-
RUN adduser --disabled-password --gecos "" --uid 1001 nonroot
18+
RUN adduser --disabled-password --gecos "" --uid 65532 nonroot
1919

2020

2121
FROM scratch
@@ -31,9 +31,9 @@ COPY --from=builder /etc/group /etc/group
3131
# Copy the base SSL CA certs so we can make HTTPS requests
3232
COPY --from=builder /etc/ssl/cert.pem /etc/ssl/cert.pem
3333

34-
# Run as non-root
35-
USER nonroot:nonroot
36-
WORKDIR /home/nonroot
34+
# Run as non-root. We can't use nonroot:nonroot here since in K8s:
35+
# https://github.com/kubernetes/kubernetes/blob/98eff192802a87c613091223f774a6c789543e74/pkg/kubelet/kuberuntime/security_context_others.go#L49.
36+
USER 65532:65532
3737

3838
ADD bin/authservice-${FLAVOR}-${TARGETOS}-${TARGETARCH} /usr/local/bin/authservice
3939
ENTRYPOINT ["/usr/local/bin/authservice"]

0 commit comments

Comments
 (0)