Starting Docker in debug mode
We can start Docker in debug mode to debug logs.
Getting ready
I hope you already have Docker installed on your system by now.
How to do it...
Follow these steps:
- Start the docker daemon with the debug option,
-D
. To start from the command line, you can run the following command:
$ dockerd -D
- You can also add the debug option in the Docker configuration file to start in debug mode:
$ cat /etc/docker/daemon.json { "debug": true }
How it works...
The preceding command will start Docker in daemon mode. You will see lots of useful messages as you start the daemon, such as loading up existing images, settings for firewalls (iptables
), and so on. If you start a container, you will see messages like the following:
$ docker container run alpine echo "hello world"
On Ubuntu 18.04, the Docker daemon logs can be viewed by running this command:
$ journalctl -u docker.service
Note
If you are using something other than Ubuntu 18.04, your Docker logs might be located...