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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.