Merge pull request #3728 from maxmorozoff/issue-3727

docs: Fix template error in cli example (#3727)
This commit is contained in:
Paweł Gronowski
2026-05-14 12:04:13 +02:00
committed by GitHub
+1 -1
View File
@@ -107,7 +107,7 @@ $ docker inspect --format='{{.Config.Image}}' $INSTANCE_ID
You can loop over arrays and maps in the results to produce simple text output:
```console
$ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID
$ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{with $conf}}{{(index . 0).HostPort}}{{else}}none{{end}} {{end}}' $INSTANCE_ID
```
### Find a specific port mapping