Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor User and Group Creation in Dockerfile for Improved Efficiency and Simplicity #9490

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,12 @@ RUN curl -LSs "https://github.com/scottchiefbaker/dool/archive/${DOOL_VERSION}.t
tar --strip-components=1 -xz && \
./install.py

# Check if the group ID is already created
# create group and user
ARG GROUP_ID
RUN if ! getent group "$GROUP_ID"; then \
addgroup --gid "$GROUP_ID" user; \
fi

# Check if the user ID is already created
ARG USER_ID
RUN if ! getent passwd "$USER_ID"; then \
adduser --disabled-password --gecos '' --gid "$GROUP_ID" --uid "$USER_ID" user; \
fi

RUN groupadd -g "$GROUP_ID" user || true && \
useradd -m -u "$USER_ID" -g "$GROUP_ID" -s /bin/bash user || true

ENV FWROOT=/FrameworkBenchmarks USER_ID="$USER_ID"
ENV PYTHONPATH="$FWROOT"
Expand Down