mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-03-28 21:16:20 +01:00
docker-inspect: add page (#4337)
This commit is contained in:
parent
f4ae3099c8
commit
53ec1f4318
1 changed files with 32 additions and 0 deletions
32
pages/common/docker-inspect.md
Normal file
32
pages/common/docker-inspect.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# docker inspect
|
||||
|
||||
> Return low-level information on Docker objects.
|
||||
> More information: <https://docs.docker.com/engine/reference/commandline/inspect/>.
|
||||
|
||||
- Show help:
|
||||
|
||||
`docker inspect`
|
||||
|
||||
- Display information about a container, image, or volume using a name or ID:
|
||||
|
||||
`docker inspect {{container|image|ID}}`
|
||||
|
||||
- Display a container's IP address:
|
||||
|
||||
`docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' {{container}}`
|
||||
|
||||
- Display the path to the container's log file:
|
||||
|
||||
`docker inspect --format='{{.LogPath}}' {{container}}`
|
||||
|
||||
- Display the image name of the container:
|
||||
|
||||
`docker inspect --format='{{.Config.Image}}' {{container}}`
|
||||
|
||||
- Display the configuration information as JSON:
|
||||
|
||||
`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}}`
|
Loading…
Add table
Reference in a new issue