Post date: Jun 12, 2016 12:58:32 PM
If a Docker container doesn't have sshd configured, you cannot use docker attach. 'nsenter' allows a shell to be opened in a running docker container.
# List running docker containers docker ps
# Get the Process ID for a specific docker container PID=$(docker inspect --format {{.State.Pid}} <container_name_or_ID>)
# Open a shell for the docker container nsenter --target $PID --mount --uts --ipc --net --pid