Skip to content

Commit 2ba1c94

Browse files
maxmorozoffthaJeztah
authored andcommitted
docs: Fix template error in cli example
Signed-off-by: Max Morozov <max@morozov.page>
1 parent 2ea4dc1 commit 2ba1c94

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/reference/commandline/inspect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ $ docker inspect --format='{{.Config.Image}}' $INSTANCE_ID
107107
You can loop over arrays and maps in the results to produce simple text output:
108108

109109
```console
110-
$ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID
110+
$ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{with $conf}}{{(index . 0).HostPort}}{{else}}none{{end}} {{end}}' $INSTANCE_ID
111111
```
112112

113113
### Find a specific port mapping

0 commit comments

Comments
 (0)