By Lukas Aichbauer & Ivan Popovic | March 28, 2024 | 2 min watch
Learn all the commands needed to access and interact with running Docker Containers in 116 seconds.
docker logs <container-name/container-id>
– list everything your container has written to the Standard Input, Standard Outpu or Standard Error(STDIN/STDOUT/STDERR).
docker exec <container-name/container-id> <command-to-be-executed-inside-the-container>
– execute a command inside your container (e.g., docker exec 0099887 ls
). Important to note here, is that, this command needs to be available in the container’s file system.
docker exec --tty --interactive <container-name/container-id> sh
– create an interactive shell that is similar to an SSH connection to a server.