Skip to content

Commit 43c6db2

Browse files
committed
docs: Fix template error in cli example
Signed-off-by: Max Morozov <max@morozov.page>
1 parent 5c511f4 commit 43c6db2

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
@@ -84,7 +84,7 @@ You can loop over arrays and maps in the results to produce simple text
8484
output:
8585

8686
```console
87-
$ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID
87+
$ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{with $conf}}{{(index . 0).HostPort}}{{else}}none{{end}} {{end}}' $INSTANCE_ID
8888
```
8989

9090
### Find a specific port mapping

0 commit comments

Comments
 (0)