Docker Exec
If you want to SSH to a Docker container, use the Docker exec command.
<pre lang="bash">
docker exec -it container_name bash
I’m using a Git Bash terminal, so I have to prefix the docker command with winpty.
<pre lang="bash">
winpty docker exec -it container_name bash
Result
<pre lang="bash">
root@681bbe3f65f1:/var/www/html#
Ctrl-D to exit.