Inspect a container's configuration

Read-only
What do risk levels mean?
Read-only
Inspects state without changing anything.
Low risk
Reversible with a routine follow-up command.
Medium risk
Changes state; undo path documented.
Destructive
Deletes or overwrites; confirmation required.

Shows a container's full configuration — image, environment, mounts, network settings, and restart policy — without changing anything.

dockerinspectconfiguration

Parameters

Container name or ID to inspect.

Commands

Show the container's complete configuration and state as JSON

docker inspect <container>

Summarize the container's published port mappings

docker port <container>

Verification

docker inspect <container>

A JSON document describing the container; an error means no container by that name exists.

Undo

Not undoable

This recipe only reads configuration and changes nothing.

Pitfalls

  • Environment variables in the output may contain sensitive values; avoid pasting the full JSON into shared channels.
  • Works on stopped containers too; State.Status distinguishes running from exited.

Related