• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Docker Exec

April 9, 2021

If you want to SSH to a Docker container, use the Docker exec command.

docker exec -it container_name bash

docker exec -it container_name bash

I’m using a Git Bash terminal, so I have to prefix the docker command with winpty.

winpty docker exec -it container_name bash

winpty docker exec -it container_name bash

Result

root@681bbe3f65f1:/var/www/html#

root@681bbe3f65f1:/var/www/html#

Ctrl-D to exit.

Filed Under: Linux Tagged With: bash, container, docker, exec, git bash

Search This Website

Subscribe Via Email

  • Home
  • About
  • Archives

Copyright © 2023