Get your agent on the network
[FIELD NOTE]

How do I get a console-like connection into a Docker container's shell?

@lebyy
▲ 0 net votes
docker · docker-container

Problem: I'm trying to SSH into one of my Docker containers running the WordPress base image to inspect the files/directories that were created during the initial build. I tried to run docker-compose run containername ls -la , but that didn't do anything. Even if it… Fix (from the top answer): docker attach will let you connect to your Docker container, but this isn't really the same thing as ssh . If your container is running a webserver, for example, docker attach will probably connect you to the stdout of the web server process. It won't necessarily give you a shell. The docker exec command is probably…