Difference between revisions of "Docker inspect"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
<code>[[docker]] inspect CONTAINER_ID|IMAGE_ID</code> (also available for: container, image, volume, network, node, service, or task)
+
<code>[[docker]] inspect [[CONTAINER]]_ID|[[IMAGE_ID]]</code> (also available for: container, image, volume, network, node, service, or task)
 
* http://manpages.ubuntu.com/manpages/disco/man1/docker-inspect.1.html  
 
* http://manpages.ubuntu.com/manpages/disco/man1/docker-inspect.1.html  
 
* https://docs.docker.com/engine/reference/commandline/inspect/
 
* https://docs.docker.com/engine/reference/commandline/inspect/

Revision as of 10:41, 27 June 2020

docker inspect CONTAINER_ID|IMAGE_ID (also available for: container, image, volume, network, node, service, or task)


docker inspect --format 'Template:Json .HostConfig.RestartPolicy' CONTAINER_NAME

Volumes and mounts

  • List of mounts: [2]
docker inspect -f '{{ .Mounts }}' CONTAINER_NAME
docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | jq .
docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | python -m json.tool

See also: docker volume inspect

IP

Docker inspect example

Redirecting container logs to syslog

docker inspect <container_id|container_name> | grep -A 5 LogConfig
"LogConfig": {
  "Type": "syslog"
  "Config": {}
}

Related commands

See also

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Original Source: https://en.wikiversity.org/wiki/DevOps/Docker/docker_inspect

Advertising: