Docker Community Forums

Share and learn in the Docker community.

Unspected output for 'docker node ps' when specifying multiple nodes

Hi,

I’m currently experimenting with Docker Swarm, running Docker version 20.10.2, build 2291f61 on macOS 11.2.1. I created two Debian VMs to act as worked nodes and tinkered a bit. In general, it appears to work as expected, but I noticed a somewhat surprising behaviour of docker node ps.

On the manager node, I can inspect the task list on each of my two worker nodes:

frerich@ubuntu:~$ docker node ps swarmnode
ID                  NAME                IMAGE                               NODE                DESIRED STATE       CURRENT STATE                ERROR               PORTS
ysnydof8kirs        c4.1                192.168.178.47:5000/alpine:latest   swarmnode           Shutdown            Complete about an hour ago                       
frerich@ubuntu:~$ docker node ps swarmnode2
ID                  NAME                IMAGE                               NODE                DESIRED STATE       CURRENT STATE                ERROR               PORTS
n12xfr1i921b        c3.1                192.168.178.47:5000/alpine:latest   swarmnode2          Shutdown            Complete about an hour ago         

However, when specifying both nodes in a single invocation, I get three instead of just two rows in the table. Also, the names for the services are somewhat peculiar:

frerich@ubuntu:~$ docker node ps swarmnode swarmnode2
ID                  NAME                IMAGE                               NODE                DESIRED STATE       CURRENT STATE                ERROR               PORTS
ysnydof8kirs         \_ c4.1            192.168.178.47:5000/alpine:latest   swarmnode           Shutdown            Complete about an hour ago                       
ysnydof8kirs         \_ c4.1            192.168.178.47:5000/alpine:latest   swarmnode           Shutdown            Complete about an hour ago                       
n12xfr1i921b        c3.1                192.168.178.47:5000/alpine:latest   swarmnode2          Shutdown            Complete about an hour ago                       

Does anybody here know why that is? Why is swarmnode listed twice? I tried to find some documentation on this behaviour, but unfortunately failed. Maybe somebody here can shed some light?

  • Frerich