Skip to content

Instantly share code, notes, and snippets.

@deviantony
Created September 5, 2017 13:19
Show Gist options
  • Save deviantony/1334299c49b76823ad45fad986faf2f4 to your computer and use it in GitHub Desktop.
Save deviantony/1334299c49b76823ad45fad986faf2f4 to your computer and use it in GitHub Desktop.
Docker Swarm cluster setup with Docker in Docker
version: "2"
services:
portainer:
image: portainer/portainer:latest
container_name: "portainer-app"
command: -H unix:///var/run/docker.sock
networks:
- portainer
volumes:
- /tmp/manager_run/docker.sock:/var/run/docker.sock
manager1:
image: docker:dind
privileged: true
hostname: manager1
volumes:
- /tmp/manager_run:/var/run
networks:
- swarm
manager2:
image: docker:dind
privileged: true
hostname: manager2
networks:
- swarm
worker1:
image: docker:dind
privileged: true
hostname: worker1
networks:
- swarm
worker2:
image: docker:dind
privileged: true
hostname: worker2
networks:
- swarm
networks:
portainer:
driver: bridge
swarm:
driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment