`watch docker ps --format` 的优雅方式是什么?

What is the elegant way to `watch docker ps --format`?

问题

我正在尝试 watch 我的 运行 容器,使用如下命令:

watch docker ps --format "table {{.Image}}\t{{.Names}}\t{{.Command}}"

但不是

格式的漂亮输出
IMAGE     NAMES     COMMAND
...       ...       ...

我明白了

"docker ps" accepts no arguments.
See 'docker ps --help'.

Usage:  docker ps [OPTIONS]

List containers

有什么优雅的方法来监视 运行 容器吗?

解决方案

发布这个问题后不久,我找到了解决方案。

添加single-quotes'...'解决问题。

watch 'docker ps --format "table {{.Image}}\t{{.Names}}\t{{.Command}}"'