Editing Docker inspect

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{lc}}
+
<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/
  
 +
* 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 inspect xxxxxx | grep Os
+
<pre>docker inspect -f '{{ .Mounts }}' CONTAINER_NAME</pre>
 
 
 
 
docker inspect xxxxxx | grep -i [[memory]]
 
            "[[Memory]]": 37748736000,
 
            "[[KernelMemory]]": 0,
 
            "[[KernelMemoryTCP]]": 0,
 
            "[[MemoryReservation]]": 0,
 
            "[[MemorySwap]]": 75497472000,
 
            "[[MemorySwappiness]]": null,
 
 
 
 
 
 
 
[[Docker Start configuration behavior and restart policy|Restart policy]]: <ref>https://stackoverflow.com/questions/43108227/is-it-possible-to-show-the-restart-policy-of-a-running-docker-container</ref>
 
  
* <code><nowiki>docker inspect --format '{{json .HostConfig.RestartPolicy}}' CONTAINER_NAME</nowiki></code>
+
<pre>docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | jq</pre>
  
[[Docker network|Network]]
+
<pre>docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | python -m json.tool</pre>
* <code>docker inspect your-container | grep [[NetworkMode]]</code>
 
 
 
== Volumes and mounts ==
 
* List of mounts: <ref>https://stackoverflow.com/questions/30133664/how-do-you-list-volumes-in-docker-containers</ref>
 
<code><nowiki>docker inspect -f '{{ .Mounts }}' CONTAINER_NAME</nowiki></code>
 
<code><nowiki>docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | jq .</nowiki></code>
 
<code><nowiki>docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | python -m json.tool</nowiki></code>
 
  
 
See also: <code>[[docker volume inspect]]</code>
 
See also: <code>[[docker volume inspect]]</code>
 
== [[IP]] ==
 
* <code>[[docker inspect]] CONTAINER_NAME | grep [[IPAddress]]</code>
 
<pre>
 
docker inspect --format "{{ .NetworkSettings.IPAddress }}"
 
</pre>
 
 
== [[Start]] contiguration ==
 
* <code>docker inspect -f "{{ .HostConfig.[[RestartPolicy]]}}" $([[docker ps -a]] -q)</code>
 
  
 
== [[Docker inspect example]] ==
 
== [[Docker inspect example]] ==
Line 47: Line 19:
 
  docker inspect <container_id|container_name> | grep -A 5 LogConfig
 
  docker inspect <container_id|container_name> | grep -A 5 LogConfig
  
 
+
<pre>
"[[LogConfig]]": {
+
"LogConfig": {
  "Type": "syslog"
+
  "Type": "syslog"
  "Config": {}
+
  "Config": {}
}
+
}
 
+
</pre>
== OOM ==
 
{{Docker inspect OOM}}
 
 
 
 
 
docker inspect [[your_container]] | grep [[mem]]
 
  
 
== Related commands ==
 
== Related commands ==
 
* <code>[[docker image inspect]]</code>
 
* <code>[[docker image inspect]]</code>
* <code>[[docker container inspect]]</code>
+
* <code>[[docker image inspect]]</code>
* <code>[[docker volume inspect]]</code>
 
* [[docker buildx inspect]]
 
  
 
== See also ==
 
== See also ==
* {{docker inspect}}
+
* {{docker}}
* {{docker cmd}}
+
 
  
[[Category:Docker]]
+
[[Category:Cloud computing]]
 +
[[Category:Software development]]
 +
[[Category:Server administration]]
  
 
{{CC license}}
 
{{CC license}}
 
Original Source: https://en.wikiversity.org/wiki/DevOps/Docker/docker_inspect
 
Original Source: https://en.wikiversity.org/wiki/DevOps/Docker/docker_inspect

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: