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
dmcnnccovhssuhcmeermk/onnloetdttdrmeep7rr7r/55un5-/5nsVue/hs/nuerutsl/srerplrmr/o/lclj/oaopuclcesa/atrlbla//i/zlbnbzoi/iocndn/a/o/nlncds/skoebeecninrktnt-ee/eerrrn-tecenarttehr/tntspesn:t/e/rra>w./gtimtph/unbsuesnetrecrontent.com/jpetazzo/nsenter/master/docker-enter

Now you have installed nsenter and docker-enter you need to lauch a container to conect to;

Connecting to Docker Containers 2/2
dddddoooooccccckkkkkeeeeerrrrr---rleeeuonnnngtttseee-rrrdtettt-seeeptsssittt3niii3gnnn0ggg6:#lp3ss3E0n--6tlaehuraxsn#atvmhaSeerh/otclweoissnbtt/tiamhniyegnseqrrrluu,/nsnst#imyncpLgkeiespnetrdxsoricittechsktes/oemcsaeorxniitatednbt_sOofvar/lib/mysql/

You can view this process in the embedded terminal session below or on my asciinema profile

Installing nsenter