Difference between revisions of "Docker inspect"
Jump to navigation
Jump to search
Line 14: | Line 14: | ||
== Volumes and mounts == | == Volumes and mounts == | ||
* List of mounts: <ref>https://stackoverflow.com/questions/30133664/how-do-you-list-volumes-in-docker-containers</ref> | * List of mounts: <ref>https://stackoverflow.com/questions/30133664/how-do-you-list-volumes-in-docker-containers</ref> | ||
− | docker inspect -f '{{ .Mounts }}' CONTAINER_NAME | + | <code><nowiki>docker inspect -f '{{ .Mounts }}' CONTAINER_NAME</code></nowiki> |
− | docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | jq . | + | <code><nowiki>docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | jq .</code></nowiki> |
− | docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | python -m json.tool | + | <code><nowiki>docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | python -m json.tool</code></nowiki> |
See also: <code>[[docker volume inspect]]</code> | See also: <code>[[docker volume inspect]]</code> |
Revision as of 09:45, 11 April 2023
docker inspect CONTAINER_ID|IMAGE_ID
(also available for: container, image, volume, network, node, service, or task)
- http://manpages.ubuntu.com/manpages/disco/man1/docker-inspect.1.html
- https://docs.docker.com/engine/reference/commandline/inspect/
docker inspect --format '{{json .HostConfig.RestartPolicy}}' CONTAINER_NAME
docker inspect your-container | grep NetworkMode
Contents
Volumes and mounts
- List of mounts: [2]
docker inspect -f '{{ .Mounts }}' CONTAINER_NAME</code>
docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | jq .</code>
docker inspect -f '{{ json .Mounts }}' CONTAINER_NAME | python -m json.tool</code>
See also: docker volume inspect
IP
docker inspect CONTAINER_NAME | grep IPAddress
docker inspect --format "{{ .NetworkSettings.IPAddress }}"
Start contiguration
docker inspect -f "{{ .HostConfig.RestartPolicy}}" $(docker ps -a -q)
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,
Related commands
See also
docker inspect, docker container inspect, docker image inspect, docker volume inspect
docker
[config | pull
| push
| run
| start
, | stop
| cp
| events
| info
| version
| build
| commit
| image
| images
| image ls
|image inspect
| rmi
| rm
| tag
| exec | rename | manifest | save | service update | load
], docker --help
Docker: docker-compose
, Docker Desktop, Docker Scout, Docker Swarm, Docker Volumes, Docker images management, docker network, docker inspect
, docker volume inspect
, Dockerfile
, Docker Engine release notes,docker kill
, moby
, Docker-in-Docker, docker context
, buildx
, docker tag
, docker system prune
, Docker Hub, hub-tool, /etc/docker/daemon.json
, hostconfig.json
, dockerd, logs, Docker logging, Backup, docker service
, depends on
, --dns, --filter
, --mount
, docker login
, docker build
, apt remove docker.io
, .dockerignore
, docker context ls
| docker-machine, .docker/
, PWD, $HOME/.docker/config.json
, Docker ID, --env-file, docker --help
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: