remove hard-coded uid 1000
Some checks failed
Sync with private repo / sync (push) Has been cancelled
Run tests / tests (3.12) (push) Has been cancelled
Run tests / tests (3.9) (push) Has been cancelled

This commit is contained in:
Florian du Garage Num 2025-09-30 21:42:59 +02:00
parent 95fe3e3cc3
commit d9867471a4
2 changed files with 3 additions and 3 deletions

View File

@ -15,8 +15,8 @@ spec:
app.kubernetes.io/name: credentials app.kubernetes.io/name: credentials
spec: spec:
securityContext: securityContext:
runAsUser: 1000 runAsUser: {{ APP_USER_ID }}
runAsGroup: 1000 runAsGroup: {{ APP_USER_ID }}
containers: containers:
- name: credentials - name: credentials
image: {{ CREDENTIALS_DOCKER_IMAGE }} image: {{ CREDENTIALS_DOCKER_IMAGE }}

View File

@ -111,7 +111,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
&& apt install -y libxml2 libmysqlclient-dev media-types mailcap && apt install -y libxml2 libmysqlclient-dev media-types mailcap
# From then on, run as unprivileged "app" user # From then on, run as unprivileged "app" user
ARG APP_USER_ID=1000 ARG APP_USER_ID={{ HOST_USER_ID }}
RUN if [ "$APP_USER_ID" = 0 ]; then echo "app user may not be root" && false; fi RUN if [ "$APP_USER_ID" = 0 ]; then echo "app user may not be root" && false; fi
RUN useradd --home-dir /openedx --create-home --shell /bin/bash --uid ${APP_USER_ID} app RUN useradd --home-dir /openedx --create-home --shell /bin/bash --uid ${APP_USER_ID} app
USER ${APP_USER_ID} USER ${APP_USER_ID}