Commit d97baa14 authored by Damian Alvarez Mallon's avatar Damian Alvarez Mallon
Browse files

To really create the groups and add them to the user

parent 5a734f7b
Pipeline #89432 passed with stages
in 8 minutes and 43 seconds
......@@ -36,17 +36,16 @@ RUN ml --version \
# --build-arg USER_ID=$(id -u ${USER}) \
# --build-arg GROUP_ID=$(id -g ${USER})
USER root
RUN groupadd amber &&\
groupadd cpmd &&\
groupadd namd &&\
usermod -a -G amber,cpmd,namd easybuild
RUN if [ ${USER_ID:-0} -ne 0 ] && [ ${GROUP_ID:-0} -ne 0 ]; then \
userdel -f easybuild &&\
if getent group easybuild ; then groupdel easybuild; fi &&\
groupadd -g ${GROUP_ID} easybuild &&\
groupadd -g ${GROUP_ID} amber &&\
groupadd -g ${GROUP_ID} cpmd &&\
groupadd -g ${GROUP_ID} namd &&\
useradd -l -u ${USER_ID} -g easybuild easybuild &&\
useradd -l -u ${USER_ID} -g amber easybuild &&\
useradd -l -u ${USER_ID} -g cpmd easybuild &&\
useradd -l -u ${USER_ID} -g namd easybuild &&\
usermod -a -G amber,cpmd,namd easybuild &&\
install -d -m 0755 -o easybuild -g easybuild /home/easybuild &&\
chown --silent --no-dereference --recursive \
--from=1000:1000 ${USER_ID}:${GROUP_ID} \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment