RPi-Distro / pi-gen

Tool used to create the official Raspberry Pi OS images
BSD 3-Clause "New" or "Revised" License
2.58k stars 1.61k forks source link

Check that docker is not set up in rootless mode #679

Closed stefanb2 closed 1 year ago

stefanb2 commented 1 year ago

By default I use Docker in rootless mode, i.e. the Docker daemon is not running as root. I have not been able to execute the docker build, because mounting of binfmt_misc fails:

+ docker run --name pigen_work --privileged --cap-add=ALL ... pi-gen bash -e -o pipefail -c 'dpkg-reconfigure qemu-user-static &&
        # binfmt_misc is sometimes not mounted with debian bullseye image
        (mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc || true) &&
        cd /pi-gen; ./build.sh  &&
        rsync -av work/*/build.log deploy/'
mount: /proc/sys/fs/binfmt_misc: permission denied.
Module binfmt_misc not loaded in host
Please run:
  sudo modprobe binfmt_misc

The work around is to use sudo docker, but build-docker.sh doesn't allow me to specify that.

This PR changes two things in the script:

XECDesign commented 1 year ago

I don't use docker myself, so I'm happy to take your word for it. Okay to merge now?

stefanb2 commented 1 year ago

I don't use docker myself, so I'm happy to take your word for it. Okay to merge now?

Please go ahead and merge. Thank you.