Skip to content

Instantly share code, notes, and snippets.

@daviddyball
Created September 1, 2016 11:40
Show Gist options
  • Save daviddyball/85cf3428f93ea706003b6a874b60f9cb to your computer and use it in GitHub Desktop.
Save daviddyball/85cf3428f93ea706003b6a874b60f9cb to your computer and use it in GitHub Desktop.
docker network create --driver overlay test-net
docker service create --name test-server \
--publish 80:80 \
--replicas 1 \
--network test-net \
debian:latest \
/bin/bash -lc "apt-get update && apt-get install -y netcat && echo test > /tmp/page.html; while true; do nc -l 80 < /tmp/page.html; done"
docker service create --name test-consumer \
--replicas 2 \
--network test-net \
debian:latest \
/bin/bash -lc "sleep 3600"
@daviddyball
Copy link
Author

If I have 5 nodes (3 exclusive managers, 2 workers), I end up with test-server running on worker1 and a copy of test-consumer on both worker1 and worker2 however test-consumer on worker2 can't resolve test-server via DNS or access it via the service VIP.

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