Docker Community Forums

Share and learn in the Docker community.

Chroot inside docker containers?


(Ajnouri) #1

Knowing that one of the main features of docker is the level of isolation it offers from the host fs, does it still make sense to use chroot inside containers?


(Justin Cormack) #2

No, using chroot inside containers is not particularly useful as a security measure. Docker itself provides more isolation. Some services may still use it of course, but if you have a minimal container it does not provide any real benefits.


(Michael R. Lawrence) #3

chroot for building in docker atm might be of use…

host root @ amd64
/chroot pi or arm64 /chroot vol of arm/arm64 os…

for Gentoo arm64 may need switch to unicorn … qemu at times has gone flaky in hosted docker…


(Rajudev) #4

No, using chroot inside containers is not particularly useful as a security measure.

Understood, but there can be usecases where chroot wants to be used.

Like building ISO images which usually use chroots for building ISOs

I am still look for ways on executing chroot inside the container