Menu
Coddy logo textTech

Inspecting Details

Part of the Introduction to Docker section of Coddy's Terminal journey — lesson 18 of 40.

Docker stores a lot of detail about every container: its status, the image it came from, its network settings, and more. The docker inspect command shows all of it as JSON.

That is usually more than you want. The --format flag lets you pull out just one field using a Go-template placeholder:

docker inspect --format "{{.State.Status}}" web

This prints just the container's status, for example running. Other handy placeholders include {{.Config.Image}} for the image name. The format string turns a wall of JSON into the single value you actually need.

challenge icon

Challenge

Easy

Start a detached nginx container named app, then use docker inspect with --format "{{.State.Status}}" to print just its status.

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Introduction to Docker