Skip to content

Instantly share code, notes, and snippets.

@alexellis
Last active June 28, 2017 18:16
Show Gist options
  • Save alexellis/cb2106e1d9eebcd5f0b89194c58fcd83 to your computer and use it in GitHub Desktop.
Save alexellis/cb2106e1d9eebcd5f0b89194c58fcd83 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