Docker Swarm Commands

This tutorial requires connection to the internet as swarm creation and management needs Docker Hub. Requirements Windows Docker CE VirtualB...

This tutorial requires connection to the internet as swarm creation and management needs Docker Hub.

Requirements


  • Windows
  • Docker CE
  • VirtualBox
*Needless to say, a docker for windows must be running.


docker run swarm create
--Download the swarm image locally. Returns a unique id that is required to create a cluster. Example: TOKEN_ID.

docker-machine create -d hyperv --swarm --swarm-master --swarm-discovery token://TOKEN_ID swarm-master
--Create the swarm. controller.

docker-machine create -d hyperv --swarm --swarm-discovery token://TOKEN_ID swarm-node-01
docker-machine create -d hyperv --swarm --swarm-discovery token://TOKEN_ID swarm-node-02
--Add swarm nodes

Use --virtualbox-no-vtx-check, if you're going to use virtualbox

--List all the running machines
docker-machine ls
docker run swarm list token://TOKEN_ID

--Remove from the swarm
docker node rm swarm-node-01

--Demote a swarm master so it can be deleted
docker node demote swarm-master

--Remove the node docker machine
docker-machine rm swarm-node-01

--connect to the master node
docker-machine ssh swarm-master

--must be executed on master node
--creates a swarm
docker swarm init --advertise-addr <SWARM-MASTER-IP>

--login to swarm-node-01 and swarm-node-02 and perform the join command below
--join a machine as a node to the swarm
docker swarm join --token TOKEN_ID <swarm-master-ip>:2377

--what if we forgot the token for joining the swarm?
docker swarm join-token worker

--displays the information about the swarm
docker node ls

Reference

  • https://docs.docker.com/engine/swarm/stack-deploy/#push-the-generated-image-to-the-registry

COMMENTS

mas template
Name

amazon,1,angular,8,bigdata,2,business,1,course-spring,27,courses,6,database,4,docker,3,java,50,kafka,1,keycloak,4,microservices,5,mysql,1,neworking,1,nosql,2,php,1,pinned,2,react,3,server management,7,shared drive,1,spring,7,synology,1,troubleshooting,2,web,1,wordpress,1,
ltr
item
toztech: Docker Swarm Commands
Docker Swarm Commands
toztech
https://toztech.blogspot.com/2018/09/docker-swarm-commands.html
https://toztech.blogspot.com/
https://toztech.blogspot.com/
https://toztech.blogspot.com/2018/09/docker-swarm-commands.html
true
2554149350007112447
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content