42. Docker Stack Part 1

Published: 19 July 2022
on channel: iMustLearn
39
0

Example 1:
-------------
vi example1.yml
version: "3.8"
services:
web_nginx:
image: nginx
ports:
"8080:80"
deploy:
mode: replicated
replicas: 3
busybox_untility:
image: radial/busyboxplus:curl
command: /bin/sh -c "while true; do sleep 10; done"

docker stack deploy -c example1.yml app1
docker stack ls
docker stack services app1
docker stack ps app1
docker stack rm app1

Example 2:
--------------
vi example2.yml
version: "3.8"
services:
web_nginx:
image: nginx
ports:
"8080:80"
deploy:
mode: replicated
replicas: 4
placement:
constraints:
"node.role!=manager"
preferences:
spread: node.labels.mynode
busybox_untility:
image: radial/busyboxplus:curl
command: /bin/sh -c "while true; do sleep 10; done"

docker stack deploy -c example2.yml app2
docker stack ls
docker stack services app2
docker stack ps app2


Watch video 42. Docker Stack Part 1 online without registration, duration hours minute second in high quality. This video was added by user iMustLearn 19 July 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 39 once and liked it 0 people.