Advanced debugging
The ability to debug containers in the wild is a very important topic and we previously covered some of the more basic techniques that can be of use here. But there are cases where docker ps
and docker exec
just aren't enough, so in this section, we will examine a few more tools you can add to your toolbox that can help resolve those tricky issues.
Attaching to a container's process space
There may be times when a container is running with a minimalist distribution such as Alpine Linux (https://www.alpinelinux.org/) and the container in question has an issue with a process that you would like to debug but also lacks the most basic tooling you need for debugging included. By default, Docker isolates all containers in their individual process namespace so our current debugging workflow, which we used before by attaching to that container directly and trying to figure out what was wrong with very limited tooling is not going to help us much here.
Luckily for us though, Docker...