File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,12 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
7070# Setup User (with UID/GID conflict handling)
7171RUN if getent passwd ${UID} > /dev/null 2>&1; then \
7272 EXISTING_USER=$(getent passwd ${UID} | cut -d: -f1); \
73+ EXISTING_GROUP=$(getent passwd ${UID} | cut -d: -f4); \
7374 deluser ${EXISTING_USER} && \
75+ if getent group ${GID} > /dev/null 2>&1; then \
76+ GROUP_NAME=$(getent group ${GID} | cut -d: -f1); \
77+ delgroup ${GROUP_NAME}; \
78+ fi; \
7479 addgroup -S -g ${GID} ${USER} && \
7580 adduser -S -D -h ${HOME} -u ${UID} -G ${USER} ${USER}; \
7681 else \
Original file line number Diff line number Diff line change @@ -70,7 +70,12 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
7070# Setup User (with UID/GID conflict handling)
7171RUN if getent passwd ${UID} > /dev/null 2>&1; then \
7272 EXISTING_USER=$(getent passwd ${UID} | cut -d: -f1); \
73+ EXISTING_GROUP=$(getent passwd ${UID} | cut -d: -f4); \
7374 deluser ${EXISTING_USER} && \
75+ if getent group ${GID} > /dev/null 2>&1; then \
76+ GROUP_NAME=$(getent group ${GID} | cut -d: -f1); \
77+ delgroup ${GROUP_NAME}; \
78+ fi; \
7479 addgroup -S -g ${GID} ${USER} && \
7580 adduser -S -D -h ${HOME} -u ${UID} -G ${USER} ${USER}; \
7681 else \
You can’t perform that action at this time.
0 commit comments