Skip to content

docker exec and docker logs

Select an icon to see what it is.

Step 3 of 6

The new process joins the container

runc starts ls and puts it in the container's existing namespaces and cgroup. So ls sees the container's filesystem and processes, not the host's. It is a second process, and PID 1 is untouched.

runc exec

setns: pid, mnt, uts, ipc, net namespaces of the container
joins the container's cgroup
/bin/ls /usr/share/nginx/html