0
My question is: is there a difference in "connecting" to a container using the instruction docker attach
and docker exec -it container /bin/bash
?
My container was created this way:
docker run -it -p 80:80 --name dev debian:stretch /bin/bash
I even read some posts on the subject, as far as I could understand, docker attach
is an instruction used to connect to the container without opening a new process, i.e., it connects to the instantiated Shell at the time of container creation.
In case I run: docker exec -it container /bin/bash
will be creating a new process.
Since Docker is a fairly new world for me, I’m not sure if this understanding is correct.