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

This commit is contained in:
Florian du Garage Num 2025-09-30 21:46:06 +02:00
parent 18d1825de7
commit fa053ac7ae
4 changed files with 8 additions and 8 deletions

View File

@ -15,8 +15,8 @@ spec:
app.kubernetes.io/name: discovery
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsUser: {{ APP_USER_ID }}
runAsGroup: {{ APP_USER_ID }}
containers:
- name: discovery
image: {{ DISCOVERY_DOCKER_IMAGE }}
@ -53,9 +53,9 @@ spec:
app.kubernetes.io/name: elasticsearch
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
runAsUser: {{ APP_USER_ID }}
runAsGroup: {{ APP_USER_ID }}
fsGroup: {{ APP_USER_ID }}
fsGroupChangePolicy: "OnRootMismatch"
containers:
- name: elasticsearch

View File

@ -1 +1 @@
{% if DISCOVERY_RUN_ELASTICSEARCH %}setowner 1000 /mounts/elasticsearch{% endif %}
{% if DISCOVERY_RUN_ELASTICSEARCH %}setowner {{ APP_USER_ID }} /mounts/elasticsearch{% endif %}

View File

@ -25,7 +25,7 @@ discovery:
soft: -1
hard: -1
restart: unless-stopped
user: "1000:1000"
user: "{{ APP_USER_ID }}:{{ APP_USER_ID }}"
volumes:
- ../../data/elasticsearch:/usr/share/elasticsearch/data
depends_on:

View File

@ -11,7 +11,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
pkg-config libsqlite3-dev media-types mailcap libbz2-dev liblzma-dev
ENV LC_ALL=en_US.UTF-8
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 useradd --home-dir /openedx --create-home --shell /bin/bash --uid ${APP_USER_ID} app
USER ${APP_USER_ID}