$ dok inspect

Readable summary of a container's configuration and state

Synopsis

dok inspect [OPTIONS] <CONTAINERS>...

Description

The inspect JSON folded into identity, state, config, resources, network, mounts and labels. Privileged mode, added capabilities, OOM kills and failing healthchecks are called out in colour.

Environment variables appear only with --env. Values whose keys look like credentials (PASSWORD, SECRET, TOKEN, API_KEY and similar) are replaced by their length unless --show-secrets is given. --json masks exactly the same way.

Arguments

<CONTAINERS>...
Container names or ids

Options

-e, --env
Print environment variables
--show-secrets
Do not mask password/token-looking env values

Every command also takes the global options: --json, --color, --icons and --theme.

Examples

$ dok inspect api  # by name, service or id prefix
$ dok inspect api --env  # include environment variables
$ dok inspect api db  # several at once

Output

Output of dok inspect against the demo stack
Rendered from dok inspect --demo, dok’s built-in example stack.

JSON output

$ dok inspect api --json
{
  "containers": [
    {
      "config": {
        "command": [
          "node",
          "dist/server.js"
        ],
        "entrypoint": [
          "docker-entrypoint.sh"
        ],
        "stop_signal": "SIGTERM",
        "user": "node",
        "working_dir": "/srv/app"
      },
      "env": null,
      "health": {
        "failing_streak": 0,
        "last_probe": {
          "exit_code": 0,
          "output": "{\"status\":\"ok\",\"db\":\"up\",\"queue\":\"up\"}\n"
        },
        "status": "healthy"
      },
      "id": "a1b2c3d4e5f60f2b7c4d8e9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c",
      "image": "sha256:2372ac0330be1f8c5d92e4a7b3c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3",
      "labels": {
        "com.docker.compose.container-number": "1",
        "com.docker.compose.project": "demo-shop",
        "com.docker.compose.service": "api",
        "org.opencontainers.image.source": "https://github.com/demo-shop/api"
      },
      "mounts": [
        {
          "destination": "/srv/app/uploads",
          "name": "demo-shop_uploads",
          "read_write": true,
          "source": "/var/lib/docker/volumes/demo-shop_uploads/_data",
          "type": "volume"
        },
        {
          "destination": "/srv/app/config.toml",
          "name": null,
          "read_write": false,
          "source": "/etc/demo-shop/api.toml",
          "type": "bind"
        }
      ],
      "name": "demo-shop-api-1",
      "platform": "linux",
      "state": {
        "exit_code": 0,
        "oom_killed": null,
        "pid": 21874,
        "restart_count": 2,
        "running": true,
        "started_at": "2026-08-17T06:12:44.118Z",
        "status": "running"
      }
    }
  ]
}

See also

dok-ps(1), dok-health(1), dok-top(1), dok(7)

dok 0.3.02026-09-27DOK-INSPECT(1)