Docker Swarm Commands
April 5, 2021 | ClusterFollow instructions on Docker for setting up Swarm and Portainer (easy)...
In Docker Swarm containers run in "services". Create a service:
docker service create --name redis --replicas=5 redis:3.0.6
Docker "ls" to list services:
docker service ls
Use secrets:
docker service create --name redis --secret secret.json redis:3.0.6
list all nodes:
docker node ls
get info fo master node:
docker info
From docker-compose file:
docker stack deploy --compose-file docker-compose.yml stackdemo
Portainer (unable to connect to the docker environment)
Update the agents should work:
docker service update portainer_agent --force
Networks
list networks:
docker network ls
create overlay network:
docker network create -d overlay nginx-net
Remove a network:
docker network rm nginx-net