DEV Community

Discussion on: Docker CLI commands and what you can do with them

Collapse
 
dmfay profile image
Dian Fay

Another very useful Docker command which lets you get a shell in a running container to see what's going on in the thing:

docker exec -ti containername /bin/bash (or /bin/sh if it doesn't have Bash installed)

Collapse
 
msoedov profile image
Alex Miasoiedov • Edited

You don't need to use full path to /bin/bash

docker exec -ti containername bash

As long as executable in the $PATH you don't have to specify a full path. /bin suppose to be in the PATH in all commonly used linux distro