DEV Community

Manuel Castellin
Manuel Castellin

Posted on • Updated on

My Top 3 Uses for "Docker Info"

The very first day I started using Docker I used docker info to verify the server was installed correctly on my Mac, and never used it again! 😅

But sometimes it's good to have this simple command in your toolbox to get information quickly. Here are my top 3 uses for docker info:

1. To verify "if" and "which" docker engine is running

It's obvious, I know, but docker info can tell you in the simplest way that the Docker daemon is alive and kicking and that its API is responding correctly.

It's also a quick way to check what Docker version you're running on

❯ docker info | head
Client:
 Debug Mode: false

Server:
 Containers: 29
  Running: 22
  Paused: 0
  Stopped: 7
 Images: 58
 Server Version: 19.03.12
Enter fullscreen mode Exit fullscreen mode

2. System resources limit: CPU & Memory

Are your containers running slowly or not starting at all? Check if your Docker daemon is running with CPU or Memory limits!

❯ docker info | grep -e CPU -e Memory
 CPUs: 2
 Total Memory: 1.945GiB
Enter fullscreen mode Exit fullscreen mode

3. Check engine's proxy settings

If you run Docker in a corporate network, is very common that you need to connect to the internet via a proxy server. If you get connection timeouts it's likely that you don't have the right settings.

❯ docker info | grep -e Proxy
 HTTP Proxy: http://proxy.mycompany.com:3128
 HTTPS Proxy: http://proxy.mycompany.com:3128
 No Proxy: localhost,127.0.0.1
Enter fullscreen mode Exit fullscreen mode

Did you know...

you can print the full list of information in JSON format with this command?

# Using "| jq" to prettify the json output, though not mandatory
❯ docker info -f '{{json .}}' | jq
Enter fullscreen mode Exit fullscreen mode

Do you use docker info often?

Tell me how in the comments!

Don't forget to follow me if you want to see more content like this!

Top comments (0)