File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ LABEL org.opencontainers.image.licenses="Apache-2.0"
2828
2929ENV APP_NAME scancodeio
3030ENV APP_USER app
31+ ENV APP_UID=1000
32+ ENV APP_GID=1000
3133ENV APP_DIR /opt/$APP_NAME
3234ENV VENV_LOCATION /opt/$APP_NAME/.venv
3335
@@ -64,9 +66,9 @@ RUN apt-get update \
6466 && apt-get clean \
6567 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
6668
67- # Create the APP_USER group and user
68- RUN addgroup --system $APP_USER \
69- && adduser --system --group --home= $APP_DIR $APP_USER \
69+ # Create the APP_USER group and user with specific UID and GID
70+ RUN groupadd --gid $APP_GID $APP_USER \
71+ && useradd --uid $APP_UID --gid $APP_GID --home-dir $APP_DIR --create-home $APP_USER \
7072 && chown $APP_USER:$APP_USER $APP_DIR
7173
7274# Create the /var/APP_NAME directory with proper permission for APP_USER
You can’t perform that action at this time.
0 commit comments