docker inspect

Prints everything Docker knows about a container or image as JSON: state, configuration, mounts, network settings and more.

In more detail

Use -f or --format with a Go template to pick one field, for example {{.State.ExitCode}} or {{.Config.Cmd}}. Inspection reads real metadata, so it answers questions a tag or a guess cannot.

Example

docker inspect exit-demo --format '{{.State.ExitCode}}'

Related terms

Taught in

References