I have 3 linux machine and I have made one machine as manager
and other two as worker1
and worker2
. So lets say I have docker image and I have tested this on manager
, it works fine. Now I want to deploy the same on all the nodes. For this, I first pushed the image to docker hub and then when its available on docker hub, I then ran the command
sudo docker service create --name <name> --mode global <docker-name/image-name>
This then started the deployment on all the worker nodes and after some time, workers were running the deployed docker image. Now I want to know is it possible to deploy the image on the worker nodes without pushing that image on docker hub. So I have a docker image locally available with me on manager node and I just want that Image to be deployed on worker nodes. How can I achieve this.?
Next I want to know, when I start my docker image I use -v
option to give path to my mount directory. How can I use this -v
to option during the deployment process?