I have been installing and exposing SSH on most of the containers I have deployed, which I know is wrong.
As I have been trying to do things in a more “devops” way I decided to do a little reading on how I can enter and leave running containers on my CentOS 7 instance without having to expose SSH or configure users.
This is when I came across nsenter & docker-enter . As you can see from the following instructions and terminal session installing nsenter and then using docker-enter to connect to a running container is a breeze;
Connecting to Docker Containers 1/2
Now you have installed nsenter and docker-enter you need to lauch a container to conect to;
Connecting to Docker Containers 2/2
You can view this process in the embedded terminal session below or on my asciinema profile