We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c511f4 commit 43c6db2Copy full SHA for 43c6db2
1 file changed
docs/reference/commandline/inspect.md
@@ -84,7 +84,7 @@ You can loop over arrays and maps in the results to produce simple text
84
output:
85
86
```console
87
-$ 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
88
```
89
90
### Find a specific port mapping
0 commit comments