Skip to content
This repository was archived by the owner on Jun 6, 2023. It is now read-only.

Commit 09a1260

Browse files
committed
Use numeric id for USER
Fixes #62
1 parent db7c61e commit 09a1260

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

alpine/latest/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ RUN apk add --no-cache brotli brotli-dev libssh2 nghttp2-dev && \
8282
###############################################################
8383
# add non privileged curl user
8484
###############################################################
85-
RUN addgroup -S curl_group && adduser -S curl_user -G curl_group
85+
86+
# To fix some errors in kubernetes, we need a numeric id. We add this test to
87+
# avoid future errors if this ever changes.
88+
RUN addgroup -S curl_group && adduser -S curl_user -G curl_group && \
89+
[ "$(cat /etc/passwd | grep curl_user | cut -d : -f3 )" -eq 100 ]
8690

8791
###############################################################
8892
# set curl ca bundle
@@ -104,7 +108,9 @@ RUN ln -s /usr/lib/libcurl.so.4 /usr/lib/libcurl.so
104108
###############################################################
105109
# set user
106110
###############################################################
107-
USER curl_user
111+
# We use a numeric id (that is tested for stability above) to avoid errors in
112+
# Kubernetes.
113+
USER 100
108114

109115
###############################################################
110116
# set entrypoint

0 commit comments

Comments
 (0)