Difference between revisions of "Docker inspect"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 3: Line 3:
 
* https://docs.docker.com/engine/reference/commandline/inspect/
 
* https://docs.docker.com/engine/reference/commandline/inspect/
  
* List of mounts: <ref>https://stackoverflow.com/questions/30133664/how-do-you-list-volumes-in-docker-containers</ref>
+
 
 
* [[Docker Start configuration behavior and restart policy|Restart policy]]: <pre>docker inspect --format '{{json .HostConfig.RestartPolicy}}' CONTAINER_NAME</pre><ref>https://stackoverflow.com/questions/43108227/is-it-possible-to-show-the-restart-policy-of-a-running-docker-container</ref>
 
* [[Docker Start configuration behavior and restart policy|Restart policy]]: <pre>docker inspect --format '{{json .HostConfig.RestartPolicy}}' CONTAINER_NAME</pre><ref>https://stackoverflow.com/questions/43108227/is-it-possible-to-show-the-restart-policy-of-a-running-docker-container</ref>
  
 +
* List of mounts: <ref>https://stackoverflow.com/questions/30133664/how-do-you-list-volumes-in-docker-containers</ref>
 
<pre>docker inspect -f '{{ .Mounts }}' CONTAINER_NAME</pre>
 
<pre>docker inspect -f '{{ .Mounts }}' CONTAINER_NAME</pre>
  

Revision as of 04:50, 26 April 2020

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


  • Restart policy:
    docker inspect --format '{{json .HostConfig.RestartPolicy}}' CONTAINER_NAME
    [1]
  • 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

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: