Debugging Docker

Sometimes the easiest way to understand what is happening in Docker is just to have a container that runs Linux … a general Linux … Ubuntu will do nicely.

It is easy to steal an idea from the Kubernetes world (Debugging Kubernetes) and apply it to Docker and Portainer
This idea from Tim Downey (https://downey.io/notes/dev/ubuntu-sleep-pod-yaml/) for Kubernetes lets you create a pod which you can exec and then just add the tools you need to to figure out what is going on from the inside of your cluster when it doesn't make sense from the outside can easily be transferred to Docker and Portainer.

In Portainer create a Container with:

Registry: DocckerHub
Image: docker.io ubuntu:latest
Command: '/bin/sleep' '64000'
Entrypoint:

Hit 'Deploy the container' and you have a container you can add the tools you need to that will clean itself up after approximately 17 hours.

Once the container is running create a console to access it.

Some useful things to add:

  • ping: apt install iputils-ping
  • host: apt install dnsutils
  • telnet: apt install telnet