Skip to content

Instantly share code, notes, and snippets.

@zinuzoid
Forked from alexellis/SwarmModeNetworking.md
Created November 15, 2016 12:06
Show Gist options
  • Save zinuzoid/3020a763659ed691e34d986341e54053 to your computer and use it in GitHub Desktop.
Save zinuzoid/3020a763659ed691e34d986341e54053 to your computer and use it in GitHub Desktop.
Mesh networking tester for Swarm Mode

Here's a quick tester for Swarm Mode that will work everywhere..

$ docker service create --name nginx1 -p 80:80 --mode=global --mount source=/etc/hostname,target=/usr/share/nginx/html/index.html,type=bind,ro nginx

You effectively bind mount the hostname as the index.html page meaning you can see the round-robin / mesh networking in action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment