docker_container
List compose project containers with state, health, and published ports, or get current CPU, memory, network, and disk stats for a service.
Instructions
Lists the containers of a project with their state, health and published ports, or measures with stats what one service consumes right now. A project name no container carries is refused with the names that exist, so an empty list means the host itself runs nothing under compose. Moving a container between states is docker_container_control.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | list: every container of the project, with state and health. stats: CPU, memory, network and disk of one service, read at this moment. | |
| profile | No | Which Docker host, by profile name. Default: the profile marked as default. | |
| project | No | Which compose project. Default: the project of the working directory. A name matching nothing is an error, not a fall back to every container on the host. Omitted with action list: every container the host runs under compose. | |
| service | No | Service name as written in the compose file. Required by action stats. | |
| compose_path | No | Where the compose file is: the file itself, or the directory holding it. Needed only when no container of the host carries the project label — a project that was never brought up there. A directory holding several compose files is refused with their names rather than guessed through. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stats | No | ||
| action | No | ||
| legend | No | What the words in this answer mean. A key names the field before the value — "state=running", "containers[].health=unhealthy" — and only the values this answer used are listed. | |
| reason | No | ||
| project | No | ||
| containers | No |