seL4 / seL4-CAmkES-L4v-dockerfiles

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

`make user` fails with `docker: Error response from daemon: Unable to find group stack.` on MacOS #23

Closed ddddavidmartin closed 4 years ago

ddddavidmartin commented 4 years ago

On my machine the make user command fails as in [0]. Not sure if this is related to running on MacOS. This is with the TZ workaround from https://github.com/SEL4PROJ/seL4-CAmkES-L4v-dockerfiles/issues/16.

If I remove the --group-add stack statements out of the Docker run commands in the Makefile it works fine. See Makefile:143 and Makefile:159.

The --group-add logic is from https://github.com/SEL4PROJ/seL4-CAmkES-L4v-dockerfiles/commit/4468454c22ad3ca56f03e33eb0af9cb9d9948e4b. I'd be happy to provide more info or do a bit more digging, though I'm not quite sure what to look for.

Thanks!

[0]

$ 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  82.94kB
Step 1/3 : ARG USER_BASE_IMG=trustworthysystems/sel4
Step 2/3 : FROM $USER_BASE_IMG
 ---> 8a4b088ab00a
Step 3/3 : RUN apt-get update -q     && apt-get install -y --no-install-recommends         cowsay         sudo
 ---> Using cache
 ---> 2bcdbd197230
Successfully built 2bcdbd197230
Successfully tagged extras:latest
docker build --force-rm=true \
        --build-arg=EXTRAS_IMG=extras \
        --build-arg=UNAME=davidm \
        --build-arg=UID=501 \
        --build-arg=GID=20 \
        --build-arg=GROUP=staff \
        -f dockerfiles/user.dockerfile \
        -t user_img-davidm .
Sending build context to Docker daemon  82.94kB
Step 1/9 : ARG EXTRAS_IMG=extras
Step 2/9 : FROM $EXTRAS_IMG
 ---> 2bcdbd197230
Step 3/9 : ARG UID
 ---> Using cache
 ---> a892a214a72e
Step 4/9 : ARG UNAME
 ---> Using cache
 ---> eaf7700c5c44
Step 5/9 : ARG GID
 ---> Using cache
 ---> af9bd3f12730
Step 6/9 : ARG GROUP
 ---> Using cache
 ---> 1ba31f073f1e
Step 7/9 : RUN groupadd -fg ${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     && grep export /root/.bashrc >> /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}
 ---> Using cache
 ---> 96226bebb062
Step 8/9 : VOLUME /home/${UNAME}
 ---> Using cache
 ---> 54d078d1551a
Step 9/9 : VOLUME /isabelle
 ---> Using cache
 ---> e967f268baec
Successfully built e967f268baec
Successfully tagged user_img-davidm:latest
docker run \
        -it \
        --hostname in-container \
        --rm \
        -u 501:20  \
        --group-add stack \
        -v /Users/davidm/Dev/seL4-CAmkES-L4v-dockerfiles:/host:z \
        -v davidm-home:/home/davidm \
        -e TZ=Australia/Sydney \
        user_img-davidm bash
docker: Error response from daemon: Unable to find group stack.
make: *** [user_run] Error 125
ddddavidmartin commented 4 years ago

Solved it by updating the images. I presume they didn't match the code changes anymore.

$ make pull_images_from_dockerhub
$ make user

This was one those problems where typing it out in an issue/email triggered the right solution in my mind.