One of the essential Docker commands is docker inspect. It lets you extract information about various docker objects knowing how to use it is something EVERYONE should know about.
In case you were wondering Docker objects or resources are simply things like containers volumes networks etc.
The main strength of inspect comes from its formatting capabilities.
For example you can extract the IP address of a running container by inspecting it and formatting in a specific way.
Docker uses go-templates for formatting its output. .
In this article first Iaposll go through the basics of Docker inspect command and then Iaposll focus on how to format the output to your specific needs.
Inspect provides you with a bunch of metadata about all the different objects managed by docker. The kind of information varies from object to object. .
For example if you inspect a volume youaposll get information related to when it was created the volume driver in use location in the host filesystem labels etc. .