List containers from all nodes of docker swarm mode

We are running docker in swarm mode on a few nodes.

Could not find a quick and easy way to list all containers (preferably with status) in the swarm from the manager nodes. One can see overlay networks and locally-running containers attached to these networks, also services - but not the container details, etc.

Is it something already available or is using the REST API the only available option? (not sure if all required info is available there though)


Solution 1:

You can do docker node ls to see all the nodes in your swarm, then docker node ps <node> to see the containers on that node.

As a one liner, you can do:

docker node ps $(docker node ls -q)