Logo Blog

Run shell inside docker container

To run a shell inside a running container for debugging purposes:

docker run -it $CONTAINER_ID /bin/sh

With newer versions of docker (and an active subscription) you can also use. This also works for images that do not ship a shell.

docker debug $CONTAINER_ID