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

Viewed 1243

Problem

I'm trying to watch my running containers, with command like this:

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

but instead of nice output in the format of

IMAGE     NAMES     COMMAND
...       ...       ...

I get

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

Usage:  docker ps [OPTIONS]

List containers

Is there any elegant way to do watch running containers?

1 Answers

Solution

Shortly after posting this question I found solution.

Adding single-quotes '...' solves the problem.

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