Difference between revisions of "Docker inspect"

From wikieduonline
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
  docker inspect xxxxxx | grep Os
 
  docker inspect xxxxxx | grep Os
 +
 +
 +
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>
 
[[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>
Line 52: Line 63:
 
* <code>[[docker container inspect]]</code>
 
* <code>[[docker container inspect]]</code>
 
* <code>[[docker volume inspect]]</code>
 
* <code>[[docker volume inspect]]</code>
 +
* [[docker buildx inspect]]
  
 
== See also ==
 
== See also ==

Latest revision as of 10:10, 12 May 2023

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


docker inspect xxxxxx | grep Os


docker inspect xxxxxx | grep -i memory
           "Memory": 37748736000,
           "KernelMemory": 0,
           "KernelMemoryTCP": 0,
           "MemoryReservation": 0,
           "MemorySwap": 75497472000,
           "MemorySwappiness": null,


Restart policy: [1]

  • docker inspect --format '{{json .HostConfig.RestartPolicy}}' CONTAINER_NAME

Network

Volumes and mounts[edit]

  • 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[edit]

docker inspect --format "{{ .NetworkSettings.IPAddress }}"

Start contiguration[edit]

Docker inspect example[edit]

Redirecting container logs to syslog[edit]

docker inspect <container_id|container_name> | grep -A 5 LogConfig


"LogConfig": {
  "Type": "syslog"
  "Config": {}
}

OOM[edit]

docker inspect grafana | grep -i OOM
           "OOMKilled": false,
           "OomScoreAdj": 0,
           "OomKillDisable": false,


docker inspect your_container | grep mem

Related commands[edit]

See also[edit]

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: