Last active
October 17, 2020 05:29
-
-
Save ulisesantana/d8680e9d98ca5eade04903c6afca2f12 to your computer and use it in GitHub Desktop.
Create portainer as docker swarm service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p /data/portainer | |
docker service create \ | |
--name portainer \ | |
--publish 9000:9000 \ | |
--replicas=1 \ | |
--constraint 'node.role == manager' \ | |
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \ | |
--mount type=bind,src=/data/portainer,dst=/data \ | |
portainer/portainer-ce -H unix:///var/run/docker.sock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment