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

Commit

Permalink
Use numeric id for USER
Browse files Browse the repository at this point in the history
Fixes #62
  • Loading branch information
j4m3s-s committed May 11, 2023
1 parent db7c61e commit e8be7e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions alpine/latest/Dockerfile
Expand Up @@ -82,7 +82,11 @@ RUN apk add --no-cache brotli brotli-dev libssh2 nghttp2-dev && \
###############################################################
# add non privileged curl user
###############################################################
RUN addgroup -S curl_group && adduser -S curl_user -G curl_group

# To fix some errors in kubernetes, we need a numeric id. We add this test to
# avoid future errors if this ever changes.
RUN addgroup -S curl_group && adduser -S curl_user -G curl_group && \
[ "$(cat /etc/passwd | grep j4m | cut -d : -f3 )" -eq 100 ]

###############################################################
# set curl ca bundle
Expand All @@ -104,7 +108,9 @@ RUN ln -s /usr/lib/libcurl.so.4 /usr/lib/libcurl.so
###############################################################
# set user
###############################################################
USER curl_user
# We use a numeric id (that is tested for stability above) to avoid errors in
# Kubernetes.
USER 100

###############################################################
# set entrypoint
Expand Down

0 comments on commit e8be7e6

Please sign in to comment.