The command docker inspect
return detailed low-level information on constructs controlled by Docker. It renders results in a JSON array.
$ docker inspect [OPTIONS] NAME|ID [NAME|ID...]
Here,
Options:
--size
, -s
→ Total file sizes if the type is the container--format
, or -f
→ Pretty-print images using a Go template--type
→ JSON for the specified type$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_ID
$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}' $INSTANCE_ID
$ docker inspect --format='{{.LogPath}}' $INSTANCE_ID
$ docker inspect --format='{{.Config.Image}}' $INSTANCE_ID
$ docker inspect --format='{{(index (index .NetworkSettings.Ports "8080/tcp") 0).HostPort}}' $INSTANCE_ID