Skip to content
Menu
All videos
Watch & learn

Learn how to access Docker containers in 116 seconds

March 28, 20242 min watchEnglish

Description

Learn all the commands needed to access and interact with running Docker Containers in 116 seconds.

Learning outcomes

  • How do I access running Docker Containers?
  • How do I check logs of a running Docker Container?
  • How do I establish a persistent connection with my running Docker Container?
  • What commands do I need?
  • How do the commands work together?

Commands You Will Learn

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.