My question is: is there a difference in "connecting" to a container using the statement docker attach
and docker exec -it container /bin/bash
?
My container was created like this:
docker run -it -p 80:80 --name dev debian:stretch /bin/bash
I came to read some posts about this subject, as far as I could understand, docker attach
is an instruction used to connect to the container without opening a new process, that is, it connects to the shell instantiated when the container was created. / p>
If I run: docker exec -it container /bin/bash
I'll be creating a new process.
As docker is a reasonably new world for me, I'm not sure if this understanding is correct.