What is a container, really?
Select an icon to see what it is.
Step 6 of 6
Its filesystem is an overlay mount
dockerd mounts the image layers read-only and adds a writable layer, all as one overlay mount under /var/lib/docker/overlay2. runc makes that mount the container's root. That is why the container sees its own files.
PrevNext
mount (inside the host)
overlay on /var/lib/docker/overlay2/<id>/merged type overlaylowerdir=<image layers>upperdir=/var/lib/docker/overlay2/<id>/diffworkdir=/var/lib/docker/overlay2/<id>/work
Try it yourself
Start a container and look at it from the host.
$ docker run -d --name web nginx$ docker top web$ ps -ef | grep "nginx: master"$ docker inspect --format '{{.State.Pid}}' web$ sudo ls -l /proc/$(docker inspect --format '{{.State.Pid}}' web)/ns$ docker rm -f web