Hands-on task
A container is just a process
A new colleague is sure a container is a small virtual machine with its own kernel and that the only way to stop it is through Docker. Show them how it really works.
- Start a container named
sleeperin the background from thebusybox:1.36image — letsleeprun inside it for an hour. - Find the container's main process among the server's ordinary processes and find out its PID on the server.
- Stop the container with
killfrom the server — with a signal to that process. Don't usedocker stop,docker killordocker rm: Docker should be the last to learn the process died.
Don't remove the sleeper container afterwards — from it your colleague will see how it exited.
- docker
- processes
- signals
- pid namespace