5.3. Using Docker Swarm Command Line¶
Make sure you can connect to the Swarm manager. In this case, the
docker info command should show all your nodes.
Below is an example for Swarm installed along with UCP (if you have installed Swarm manually, make sure to appropriately set environment variables, e.g.,
# export DOCKER_HOST=tcp://127.0.0.1:2376 # export DOCKER_TLS_VERIFY=true # export DOCKER_CERT_PATH=/var/lib/docker/volumes/ucp-auth-api-certs/_data # docker info | grep Nodes Nodes: 3
Now you can use all the Docker commands as usual, with the difference that they will see all the containers and volumes from all the nodes.
One peculiarity is that every Virtuozzo Storage volume will be listed as many times as the number of nodes you have, for example:
# docker volume ls ... ploop wp01_mysql ploop wp01_mysql ploop wp01_mysql ...
This is a known issue with Swarm, see https://github.com/docker/swarm/issues/1970 for details.