Fix the shell syntax. Remove the right user.

This commit is contained in:
Andrea Dell'Amico 2023-03-20 13:42:14 +01:00
parent bf19779bfb
commit 005ff6baf2
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ ARG EXCLUDE_VARS="HOME PASSWORD RSTUDIO_VERSION BATCH_USER_CREATION"
ARG R_HOME="/usr/local" ARG R_HOME="/usr/local"
# The 0*_ scripts cannot be used anymore # The 0*_ scripts cannot be used anymore
# ADD 01_set_env.sh /etc/cont-init.d/01_set_env # ADD 01_set_env.sh /etc/cont-init.d/01_set_env
RUN for file in /var/run/s6/container_environment/* ; do sed -i "/^${file##*/}=/d" ${R_HOME}/etc/Renviron.site ; regex="(^| )${file##*/}($| )" ; if [ ! "$exclude_vars" =~ "$regex" ] ; then echo "${file##*/}=$(cat $file)" >> ${R_HOME}/etc/Renviron.site ; fi ; done RUN for file in /var/run/s6/container_environment/* ; do sed -i "/^${file##*/}=/d" ${R_HOME}/etc/Renviron.site ; regex="(^| )${file##*/}($| )" ; [[ $exclude_vars =~ $regex ]] && echo "${file##*/}=$(cat $file)" >> ${R_HOME}/etc/Renviron.site ; done
# ADD 02_userconf.sh /etc/cont-init.d/02_userconf # ADD 02_userconf.sh /etc/cont-init.d/02_userconf
RUN mv -f /etc/rstudio/disable_auth_rserver.conf /etc/rstudio/rserver.conf RUN mv -f /etc/rstudio/disable_auth_rserver.conf /etc/rstudio/rserver.conf
@ -77,7 +77,7 @@ RUN chmod a+rx /usr/local/bin/fix-permissions
RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \ RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \
sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers && \ sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers && \
sed -i.bak -e 's/^%sudo/#%sudo/' /etc/sudoers && \ sed -i.bak -e 's/^%sudo/#%sudo/' /etc/sudoers && \
userdel -r rstudio && \ userdel -r "${NB_USER}" && \
useradd -l -m -s /bin/bash -N -u "${NB_UID}" "${NB_USER}" && \ useradd -l -m -s /bin/bash -N -u "${NB_UID}" "${NB_USER}" && \
chmod g+w /etc/passwd && \ chmod g+w /etc/passwd && \
fix-permissions "${HOME}" fix-permissions "${HOME}"