seL4 / seL4-CAmkES-L4v-dockerfiles

Dockerfiles defining the dependencies required to build seL4, CAmkES, and L4v.
13 stars 40 forks source link

make user doesn't work on mac #19

Closed awmorgan closed 4 years ago

awmorgan commented 4 years ago

got this when trying to run make user on mac: groupadd: group 'staff' already exists

full output:

~/work/seL4-CAmkES-L4v-dockerfiles (master)$ make user scripts/utils/check_for_old_docker_imgs.sh WARNING: Unable to check if your trustworthysystems docker images are getting a bit old! The date command did not behave as expected. Skipping the check. docker build --force-rm=true \ --build-arg=USER_BASE_IMG=trustworthysystems/camkes \ -f dockerfiles/extras.dockerfile \ -t extras \ . Sending build context to Docker daemon 79.87kB Step 1/3 : ARG USER_BASE_IMG=trustworthysystems/sel4 Step 2/3 : FROM $USER_BASE_IMG ---> 63930b6612d7 Step 3/3 : RUN apt-get update -q && apt-get install -y --no-install-recommends cowsay sudo ---> Using cache ---> 84a2f86c12ab Successfully built 84a2f86c12ab Successfully tagged extras:latest docker build --force-rm=true \ --build-arg=EXTRAS_IMG=extras \ --build-arg=UNAME=arthurmorgan \ --build-arg=UID=501 \ --build-arg=GID=20 \ --build-arg=GROUP=staff \ -f dockerfiles/user.dockerfile \ -t user_img-arthurmorgan . Sending build context to Docker daemon 79.87kB Step 1/9 : ARG EXTRAS_IMG=extras Step 2/9 : FROM $EXTRAS_IMG ---> 84a2f86c12ab Step 3/9 : ARG UID ---> Using cache ---> 75b0030ce337 Step 4/9 : ARG UNAME ---> Using cache ---> 04f452558ff9 Step 5/9 : ARG GID ---> Using cache ---> fc637242511c Step 6/9 : ARG GROUP ---> Using cache ---> 56a3d78a7674 Step 7/9 : RUN groupadd -g ${GID} ${GROUP} && useradd -u ${UID} -g ${GID} ${UNAME} && adduser ${UNAME} sudo && passwd -d ${UNAME} && echo 'Defaults lecture_file = /etc/sudoers.lecture' >> /etc/sudoers && echo 'Defaults lecture = always' >> /etc/sudoers && echo '##################### Warning! #####################################' > /etc/sudoers.lecture && echo 'This is an ephemeral docker container! You can do things to it using' >> /etc/sudoers.lecture && echo 'sudo, but when you exit, changes made outside of the /host directory' >> /etc/sudoers.lecture && echo 'will be lost.' >> /etc/sudoers.lecture && echo 'If you want your changes to be permanent, add them to the ' >> /etc/sudoers.lecture && echo ' extras.dockerfile' >> /etc/sudoers.lecture && echo 'in the seL4-CAmkES-L4v dockerfiles repo.' >> /etc/sudoers.lecture && echo '####################################################################' >> /etc/sudoers.lecture && echo '' >> /etc/sudoers.lecture && mkdir /home/${UNAME} && echo 'echo " "' >> /home/${UNAME}/.bashrc && echo 'echo " | | | | "' >> /home/${UNAME}/.bashrc && echo 'echo " | | || ) | )/ () | |_ | ) \/ "' >> /home/${UNAME}/.bashrc && echo 'echo " / "' >> /home/${UNAME}/.bashrc && echo 'echo " "' >> /home/${UNAME}/.bashrc && echo 'echo "( | "' >> /home/${UNAME}/.bashrc && echo 'echo ") \/ ) | (- ||| _) "' >> /home/${UNAME}/.bashrc && echo 'echo " / "' >> /home/${UNAME}/.bashrc && echo 'echo "Hello, welcome to the sel4/CAmkES/L4v docker build environment"' >> /home/${UNAME}/.bashrc && echo 'export PATH=/scripts/repo:$PATH' >> /home/${UNAME}/.bashrc && echo 'cd /host' >> /home/${UNAME}/.bashrc && mkdir -p /isabelle && chown -R ${UNAME}:${GROUP} /isabelle && ln -s /isabelle /home/${UNAME}/.isabelle && chown -R ${UNAME}:${GROUP} /home/${UNAME} && chmod -R ug+rw /home/${UNAME} ---> Running in fc11857d6ea4 groupadd: group 'staff' already exists Removing intermediate container fc11857d6ea4 The command '/bin/sh -c groupadd -g ${GID} ${GROUP} && useradd -u ${UID} -g ${GID} ${UNAME} && adduser ${UNAME} sudo && passwd -d ${UNAME} && echo 'Defaults lecturefile = /etc/sudoers.lecture' >> /etc/sudoers && echo 'Defaults lecture = always' >> /etc/sudoers && echo '##################### Warning! #####################################' > /etc/sudoers.lecture && echo 'This is an ephemeral docker container! You can do things to it using' >> /etc/sudoers.lecture && echo 'sudo, but when you exit, changes made outside of the /host directory' >> /etc/sudoers.lecture && echo 'will be lost.' >> /etc/sudoers.lecture && echo 'If you want your changes to be permanent, add them to the ' >> /etc/sudoers.lecture && echo ' extras.dockerfile' >> /etc/sudoers.lecture && echo 'in the seL4-CAmkES-L4v dockerfiles repo.' >> /etc/sudoers.lecture && echo '####################################################################' >> /etc/sudoers.lecture && echo '' >> /etc/sudoers.lecture && mkdir /home/${UNAME} && echo 'echo " "' >> /home/${UNAME}/.bashrc && echo 'echo " | | | | "' >> /home/${UNAME}/.bashrc && echo 'echo " | | || ) | )/ () | | | ) \/ "' >> /home/${UNAME}/.bashrc && echo 'echo " / "' >> /home/${UNAME}/.bashrc && echo 'echo " "' >> /home/${UNAME}/.bashrc && echo 'echo "( | "' >> /home/${UNAME}/.bashrc && echo 'echo ") \/ ) | (- ||| _) "' >> /home/${UNAME}/.bashrc && echo 'echo " / "' >> /home/${UNAME}/.bashrc && echo 'echo "Hello, welcome to the sel4/CAmkES/L4v docker build environment"' >> /home/${UNAME}/.bashrc && echo 'export PATH=/scripts/repo:$PATH' >> /home/${UNAME}/.bashrc && echo 'cd /host' >> /home/${UNAME}/.bashrc && mkdir -p /isabelle && chown -R ${UNAME}:${GROUP} /isabelle && ln -s /isabelle /home/${UNAME}/.isabelle && chown -R ${UNAME}:${GROUP} /home/${UNAME} && chmod -R ug+rw /home/${UNAME}' returned a non-zero code: 9 make: *** [build_user] Error 9 ~/work/seL4-CAmkES-L4v-dockerfiles (master)$

LukeMondy commented 4 years ago

Thanks for the report, I'll look into a fix.

LukeMondy commented 4 years ago

We've got a fix for this merged, but it's working its way through our internal CI. Should be out soon!

LukeMondy commented 4 years ago

The commit made it out here: https://github.com/SEL4PROJ/seL4-CAmkES-L4v-dockerfiles/commit/ad60adfaa84a29c08a32670978cae9fccfeb8334