linux – start docker container interactively

linux – start docker container interactively

If i understood correctly, you want to see the logs from container in terminal, same as when you run the image with docker run. If thats the case, then try with

docker start -a my_docker_container

You can enter a running container with:

docker exec -it <container name> /bin/bash

example:

docker exec -it my_new_container /bin/bash

you can replace bash with sh if bash is not available in the container.

and if you need to explicitly use a UID , like root = UID 0, you can specify this:

docker exec -it -u 0 my_new_container /bin/bash

which will log you as root

linux – start docker container interactively

Leave a Reply

Your email address will not be published.