Skip to content

Docker Swarm Notes

docker node ls
docker service create \
  --name <SERVICE-NAME> \
  --label traefik.http.services.nginx.loadbalancer.server.port=<PUBLISHED-PORT>
  --publish published=<PUBLISHED-PORT>,target=<CONTAINER-PORT> \
  <IMAGE>
docker service scale <name> =5
docker service ls
docker service ps <name>
docker service rm <name>
docker service update --label-add <label> <name>
docker service create \
  --name nginx \
  -p 8080:80 \
  nginx:alpine
docker run \
  --volume=/:/rootfs:ro \
  --volume=/var/run:/var/run:ro \
  --volume=/sys:/sys:ro \
  --volume=/var/lib/docker/:/var/lib/docker:ro \
  --volume=/dev/disk/:/dev/disk:ro \
  --publish=8081:8080 \
  --detach=true \
  --name=cadvisor \
  --privileged \
  --device=/dev/kmsg \
  gcr.io/cadvisor/cadvisor:v0.36.0

Last update: March 26, 2021
Created: March 26, 2021