Coder Perfect

Chroot vs Docker

Problem

I’m attempting to master the fundamentals of container management (Docker in this case). Docker basically provides isolation by executing the container using runc, as far as I can tell from the Docker doc and other readings (previously using LXC). It utilizes the same kernel as the host system in either case. As a result, the container image must work with the host kernel. This reminds me a lot of what a chroot does. Could someone please explain the differences and/or benefits of using Docker instead of chroot? (in addition to Docker’s extras like packaging, docker-hub, and all of Docker’s other useful features)

Asked by rkachach

Solution #1

Docker uses namespaces to isolate a process at many levels:

All of this adds to the isolation provided by chroot.

Answered by Luc

Post is based on https://stackoverflow.com/questions/46450341/chroot-vs-docker