Sfoglia il codice sorgente

HADOOP-19606. Delete the UID in the dev container that is the same as the host user

Closes #7781

Signed-off-by: Shilun Fan <slfan1989@apache.org>
Signed-off-by: Chris Nauroth <cnauroth@apache.org>
Cheng Pan 2 settimane fa
parent
commit
b023f25627
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      start-build-env.sh

+ 1 - 0
start-build-env.sh

@@ -89,6 +89,7 @@ DOCKER_HOME_DIR=${DOCKER_HOME_DIR:-/home/${USER_NAME}}
 docker build -t "hadoop-build${OS_PLATFORM_SUFFIX}-${USER_ID}" - <<UserSpecificDocker
 FROM hadoop-build
 RUN rm -f /var/log/faillog /var/log/lastlog
+RUN userdel -r \$(getent passwd ${USER_ID} | cut -d: -f1) 2>/dev/null || :
 RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME}
 RUN useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME} -d "${DOCKER_HOME_DIR}"
 RUN echo "${USER_NAME} ALL=NOPASSWD: ALL" > "/etc/sudoers.d/hadoop-build-${USER_ID}"