Inspecting containers with the docker exec command

When troubleshooting servers, the traditional way to debug is to log in and poke around the machine. With Docker, this typical workflow is split into two steps: the first is logging in to the Docker host using standard remote access tools such as SSH, and the second is entering the desired running container's process namespace with the docker exec command. This is useful as a last resort to debug what is happening inside our application.

For most of this chapter, we will troubleshoot and debug a Docker container running HAProxy. The following steps will prepare the sample container service:

  1. First, we will create the configuration for HAProxy named haproxy.cfg with the following content: ...

Get Docker High Performance - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.