We can interact with running or stopped containers. We need to interact with containers to run some processes within them, review some of their files, or retrieve the main process output. These are the main actions we will use to interact with containers:
attach |
Using attach, we will be able to connect to the main process's STDIN/STDOUT/STDERR. In other terms, we will be attached to this process to interact with it. Be careful because sending a signal with your keyboard may interrupt the process and container's life (we can omit this behavior using --sig-proxy false). We can only attach to running containers. |
cp |
This action will allow us to send /receive content to/from the container's filesystem. It acts as a normal copy but we can maintain file ownership using --archive. We will just use the source path and destination and we will use the <container>:</path_to_file> notation to reference files inside containers. Containers... |