docker-inspect: escape placeholders (#11733)
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
This commit is contained in:

committed by
GitHub

parent
9d865abee1
commit
1b6a9a1536
@@ -13,20 +13,20 @@
|
||||
|
||||
- Display a container's IP address:
|
||||
|
||||
`docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' {{container}}`
|
||||
`docker inspect --format '\{\{range.NetworkSettings.Networks\}\}\{\{.IPAddress\}\}\{\{end\}\}' {{container}}`
|
||||
|
||||
- Display the path to the container's log file:
|
||||
|
||||
`docker inspect --format='{{.LogPath}}' {{container}}`
|
||||
`docker inspect --format='\{\{.LogPath\}\}' {{container}}`
|
||||
|
||||
- Display the image name of the container:
|
||||
|
||||
`docker inspect --format='{{.Config.Image}}' {{container}}`
|
||||
`docker inspect --format='\{\{.Config.Image\}\}' {{container}}`
|
||||
|
||||
- Display the configuration information as JSON:
|
||||
|
||||
`docker inspect --format='{{json .Config}}' {{container}}`
|
||||
`docker inspect --format='\{\{json .Config\}\}' {{container}}`
|
||||
|
||||
- Display all port bindings:
|
||||
|
||||
`docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' {{container}}`
|
||||
`docker inspect --format='\{\{range $p, $conf := .NetworkSettings.Ports\}\} \{\{$p\}\} -> \{\{(index $conf 0).HostPort\}\} \{\{end\}\}' {{container}}`
|
||||
|
Reference in New Issue
Block a user