Tutorial by Examples

To execute operations in a container, use the docker exec command. Sometimes this is called "entering the container" as all commands are executed inside the container. docker exec -it container_id bash or docker exec -it container_id /bin/sh And now you have a shell in your running...
Inspecting system resource usage is an efficient way to find misbehaving applications. This example is an equivalent of the traditional top command for containers: docker stats To follow the stats of specific containers, list them on the command line: docker stats 7786807d8084 7786807d8085 D...
Inspecting system resource usage is an efficient way to narrow down a problem on a live running application. This example is an equivalent of the traditional ps command for containers. docker top 7786807d8084 To filter of format the output, add ps options on the command line: docker top 7786807...
'Attaching to a container' is the act of starting a terminal session within the context that the container (and any programs therein) is running. This is primarily used for debugging purposes, but may also be needed if specific data needs to be passed to programs running within the container. The a...
Following the logs is the less intrusive way to debug a live running application. This example reproduces the behavior of the traditional tail -f some-application.log on container 7786807d8084. docker logs --follow --tail 10 7786807d8084 This command basically shows the standard output of the co...
Docker is just a fancy way to run a process, not a virtual machine. Therefore, debugging a process "in a container" is also possible "on the host" by simply examining the running container process as a user with the appropriate permissions to inspect those processes on the host (...

Page 1 of 1