Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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