mkdir -p /mnt/docker
yum install -y rsync
* * * * * rsync -avzh /mnt/docker/ root@dm01:/mnt/docker/
* * * * * rsync -avzh /mnt/docker/ root@dm02:/mnt/docker/
* * * * * rsync -avzh /mnt/docker/ root@dm03:/mnt/docker/
* * * * * rsync -avzh /mnt/docker/ root@dm04:/mnt/docker/
~
Install Portainer with a persistent container
Code:
mkdir -p /mnt/docker/portainer/data
Code:
mkdir -p /mnt/docker/portainer/data
docker pull portainer/portainer
docker service create \
--name portainer \
--publish 9090:9000 \
--constraint 'node.role == manager' \
--mount type=bind,src=/mnt/shared/portainer,dst=/data \
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
portainer/portainer \
-H unix:///var/run/docker.sock
docker service create \
--name portainer \
--publish 9090:9000 \
--constraint 'node.role == manager' \
--mount type=bind,src=/mnt/shared/portainer,dst=/data \
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
portainer/portainer \
-H unix:///var/run/docker.sock
[root@dm01 ~]#
No comments:
Post a Comment