Skip to main content

Common Commands


Get Container

Running Containers
docker ps
All Containers
docker ps -a

Inspect Container

docker inspect foo

Get Tail Logs

docker logs --tail 100 xxx

Get Mounts Info

docker inspect foo | grep -A 10 -i mounts
"Mounts": [
    {
        "Type": "bind",
        "Source": "xxx",
        "Destination": "xxx",
        "Mode": "",
        "RW": true,
        "Propagation": "rprivate"
    }
]

Get Volumes

docker volume ls
DRIVER  VOLUME NAME
local   0c9658033cba5db4652849467b9ace2ad40e74db5c160fccef0100180f145a13
local   0c82598530ad71b395a903130296f0689ea6b7fcb15a6c00fd8f8bdf2e712731

Get IP Info

docker inspect foo | grep -A 15 Networks

Stats Container

docker stats foo

Inspect Images Manifests

docker buildx imagetools inspect registry.example.com/ops-center:130
Name:      registry.example.com/ops-center:130
MediaType: application/vnd.docker.distribution.manifest.list.v2+json
Digest:    sha256:061206dc29d6d99cd254fda889a6157c66908d85ddb0d2d6a371af92a91ba11d

Manifests:
  Name:      registry.example.com/ops-center:130@sha256:71ee0534f747600ae6b3d864d6645b85e8f8cd85ea7b27d3469f58c2ac9a0262
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/amd64

  Name:      registry.example.com/ops-center:130@sha256:cfb7de94eb9db1c950a2892367fb740a07e921e360fe5dc684d7bb8fd5ad69b3
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/arm64