Difference between revisions of "Docker inspect"

From wikieduonline
Jump to navigation Jump to search
Line 54: Line 54:
 
* {{docker inspect}}
 
* {{docker inspect}}
 
* {{docker cmd}}
 
* {{docker cmd}}
* {{docker}}
 
  
 
+
[[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

Revision as of 15:36, 18 April 2023

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


Restart policy: [1]

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

Network

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 --format "{{ .NetworkSettings.IPAddress }}"

Start contiguration

Docker inspect example

Redirecting container logs to syslog

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


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

OOM

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


docker inspect your_container | grep mem

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: