Skip to content

Instantly share code, notes, and snippets.

@ulisesantana
Last active October 17, 2020 05:29
Show Gist options
  • Save ulisesantana/d8680e9d98ca5eade04903c6afca2f12 to your computer and use it in GitHub Desktop.
Save ulisesantana/d8680e9d98ca5eade04903c6afca2f12 to your computer and use it in GitHub Desktop.
Create portainer as docker swarm service
#!/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