1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-24 01:02:09 +02:00
tldr/pages/common/docker-inspect.md
Vitor Henrique 61405c6e0e
pages*: fix small typos (#11850)
* pages*: fix small typos

* pages/*: make help and version commands consistent

* pages/*: follow "path/to/file" pattern

* nop: generic display help wording
2023-12-27 12:11:30 +05:30

970 B

docker inspect

Return low-level information on Docker objects. More information: https://docs.docker.com/engine/reference/commandline/inspect/.

  • Display help:

docker inspect

  • Display information about a container, image, or volume using a name or ID:

docker inspect {{container|image|ID}}

  • Display a container's IP address:

docker inspect --format '\{\{range.NetworkSettings.Networks\}\}\{\{.IPAddress\}\}\{\{end\}\}' {{container}}

  • Display the path to the container's log file:

docker inspect --format='\{\{.LogPath\}\}' {{container}}

  • Display the image name of the container:

docker inspect --format='\{\{.Config.Image\}\}' {{container}}

  • Display the configuration information as JSON:

docker inspect --format='\{\{json .Config\}\}' {{container}}

  • Display all port bindings:

docker inspect --format='\{\{range $p, $conf := .NetworkSettings.Ports\}\} \{\{$p\}\} -> \{\{(index $conf 0).HostPort\}\} \{\{end\}\}' {{container}}