# docker inspect: Low-Level Container & Image Detail

> How docker inspect works: dumping JSON metadata for containers, images, volumes, and networks, with --format for scripting in CI.

Source: https://latchkey.dev/learn/command-reference/docker-inspect-command  
Updated: 2026-06-25

Get the full JSON metadata for any Docker object, scriptable with --format.

docker inspect returns low-level JSON for containers, images, networks, and volumes. This page covers extracting fields with Go templates, the workhorse for CI scripts.

## What it does

docker inspect dumps the full configuration and state of an object as JSON: container exit code, health, mounts, network IPs, image config, and more. --format pulls a single field for scripts.

## Common usage

```Terminal
docker inspect web
docker inspect --format '{{.State.ExitCode}}' web
docker inspect --format '{{.State.Health.Status}}' web
docker inspect --format '{{json .NetworkSettings.Ports}}' web
```

## Common errors in CI

"Error: No such object: NAME" means the container/image does not exist - check the name. A common scripting bug is "<no value>" output when a field is null or the path is wrong (e.g. .State.Health on a container with no HEALTHCHECK); guard for it. Use docker inspect --format '{{.State.ExitCode}}' to read a CI container exit code reliably.

## FAQ

### docker inspect: Low-Level Container & Image Detail?

docker inspect returns low-level JSON for containers, images, networks, and volumes. This page covers extracting fields with Go templates, the workhorse for CI scripts.

### What it does?

docker inspect dumps the full configuration and state of an object as JSON: container exit code, health, mounts, network IPs, image config, and more. --format pulls a single field for scripts.

### Common errors in CI?

"Error: No such object: NAME" means the container/image does not exist - check the name. A common scripting bug is "<no value>" output when a field is null or the path is wrong (e.g. .State.Health on a container with no HEALTHCHECK); guard for it. Use docker inspect --format '{{.State.ExitCode}}' to read a CI container exit code reliably.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
