How to connect to a docker shell of an running docker-container

$ sudo docker exec -i -t 665b4a1e17b6 /bin/bash #by ID or $ sudo docker exec -i -t loving_heisenberg /bin/bash #by Name $ root@665b4a1e17b6:/#

If you want to get on the CLI of an running docker-container just use docker's exec command.

sudo docker

  • by-name:

  • First list all running containers:

    sudo docker ps

This will result in something like this: docker ps

Now you can call the container's bash-exe and you get on the CLI. You can do this by name or by container-id

  • by name

    sudo docker exec -i -t arangodb-server /bin/bash
  • by container-id

    sudo docker exec -i -t 8fd98d632eb2 /bin/bash