Managing container behavior
The container runtime will help us understand containers’ behavior by providing a set of options for reviewing process logs, copying files to and from containers, executing processes inside them, and so on.
The following actions allow us to interact with container processes and filesystems:
exec
: We can attach new processes to the containers’ namespaces by usingdocker container exec
. This option will allow us to run any script or binary included in the container’s filesystems or mounted columns.attach
: When a container is running in the background, detached from the container runtime client’s command line, we can attach its output by using this action. We will attach the Docker client to the container’s main process; hence, all the output and errors will be shown in our terminal. Take care with this option because you should detach from the container’s main process output to free your terminal. Do...