Open a shell in a running Docker container
docker exec bash into container | how to get shell in docker container | docker exec -it sh | docker | exec | debuggingdocker exec -it app shOpens a shell in the already running container, and exit gets you back out without stopping the container. sh is available almost everywhere, many Debian-based images also include bash, slim Alpine images do not.
Note: Changes inside the container are lost when it is recreated, permanent adjustments belong in the image or in a volume. Docker commands require root or the docker group.
Also searched as
- docker exec bash into container
- how to get shell in docker container
- docker exec -it sh