docker-inspect
Display detailed information about Docker objects
TLDR
Display information about a container, image, or volume using a name or ID
Display a container's IP address
Display the path to the container's log file
Display the image name of the container
Display the configuration information as JSON
Display all port bindings
Display help
SYNOPSIS
docker inspect [OPTIONS] NAME|ID [NAME|ID...]
PARAMETERS
--format, -f string
Format output using a custom Go template (e.g., '{{.Name}}')
--pretty
Print value as pretty-printed JSON for readability
--type string
Limit output to specific type (container, image, volume, network, node, plugin, secret, service, task)
-h, --help
Display help for inspect
DESCRIPTION
docker inspect retrieves low-level details about Docker objects like containers, images, volumes, networks, services, nodes, plugins, secrets, and tasks. It outputs data in JSON format by default, perfect for scripting, debugging, and automation.
Specify one or more names or IDs as arguments. The command queries the Docker daemon for comprehensive metadata, including configuration, state, mounts, environment variables, labels, and runtime stats.
Key features include customizable output via Go templates with --format, pretty-printed JSON with --pretty, and type filtering with --type. This enables extracting specific fields, e.g., container IP or image size, without parsing full JSON.
Ideal for troubleshooting (e.g., checking why a container fails), CI/CD pipelines, and monitoring tools. Note it shows historical data for stopped objects.
CAVEATS
Requires running Docker daemon; verbose JSON output by default; -f is deprecated (use --format); does not modify objects.
COMMON EXAMPLES
docker inspect mycontainer # Full container JSON
docker inspect --format '{{.NetworkSettings.IPAddress}}' mycontainer # Container IP only
docker inspect --type image myimage --pretty # Pretty image details
TEMPLATE FUNCTIONS
Supports Go template funcs like json, printf, title, lower, split for advanced formatting.
HISTORY
Part of Docker CLI since initial 2013 release (v0.5+); evolved with Docker Engine, adding type filtering in v1.12+ and template enhancements.
SEE ALSO
docker-ps(1), docker-images(1), docker-logs(1), docker-stats(1)


