How to bind mount the chroot directory onto the chroot / #149
Open
Description
Hi,
Is there a way to bind mount the chroot directory onto / ?
I need to get docker pull working in the chroot, and in order for docker pull to work properly I need to bind mount the chroot directory onto the chroot /
Ie. mount -o bind chroot-ubuntu chroot-ubuntu/
Here's the full working chroot example:
mkdir chroot-ubuntu
debootstrap --variant=buildd jammy chroot-ubuntu
mount -o bind chroot-ubuntu chroot-ubuntu/
mount --rbind /sys chroot-ubuntu/sys
mount --rbind /dev chroot-ubuntu/dev
mount -t proc /proc chroot-ubuntu/proc
chroot chroot-ubuntu /bin/bash
apt update
apt install -y iptables curl
curl -fsSL https://get.docker.com | sh
/usr/bin/dockerd --iptables=False &
sleep 2
docker pull alpine
Here is the thread where the chroot bind mount was suggested to fix the docker pull issue.
moby/moby#34817