docker compose 事件
| 描述 | 从容器接收实时事件 |
|---|---|
| 用法 | docker compose events [OPTIONS] [SERVICE...] |
描述
流式传输项目中每个容器的事件。
使用 --json 标志,会以以下格式每行打印一个 json 对象:
{
"time": "2015-11-20T18:01:03.615550",
"type": "container",
"action": "create",
"id": "213cf7...5fc39a",
"service": "web",
"attributes": {
"name": "application_web_1",
"image": "alpine:edge"
}
}可以使用此功能接收的事件可以在 此处查看。
选项
| 选项 | 默认 | 描述 |
|---|---|---|
--json | 将事件输出为 JSON 对象流 |