Executing processes in a running container
In the Podman daemonless architecture section of Chapter 2, Comparing Podman and Docker, we talked about the fact that Podman, as with any other container engine, leverages the Linux namespace functionality to correctly isolate running containers from each other and from the OS host as well.
So, just because Podman creates a brand-new namespace for every running container, it should not be a surprise that we can attach to the same Linux namespace of a running container, executing other processes just as in a full operating environment.
Podman gives us the ability to execute a process in a running container through the podman exec
command.
Once executed, this command will find internally the right Linux namespace to which the target running container is attached. Having found the Linux namespace, Podman will execute the respective process, passed as an argument to the podman exec
command, attaching it to the target Linux namespace...