Skip to content

Instantly share code, notes, and snippets.

@mbentley
Last active December 19, 2017 19:29
Show Gist options
  • Save mbentley/7ae47e6ec7064a152039ada6407a81cc to your computer and use it in GitHub Desktop.
Save mbentley/7ae47e6ec7064a152039ada6407a81cc to your computer and use it in GitHub Desktop.
Windows Overlay Test
# create overlay network to test
docker network create -d overlay --attachable winoverlaytest
# run iis on two different nodes, attached to the same network
docker service create --name iis1 --network winoverlaytest --constraint "node.hostname==server2016-1" --endpoint-mode dnsrr microsoft/iis:nanoserver
docker service create --name iis2 --network winoverlaytest --constraint "node.hostname==server2016-2" --endpoint-mode dnsrr microsoft/iis:nanoserver
# hit iis2 from iis1
docker exec -it $(docker inspect --format '{{.Status.ContainerStatus.ContainerID}}' $(docker service ps --filter desired-state=running --format '{{.ID}}' iis1)) powershell Invoke-WebRequest http://iis2/
# hit iis1 from iis2
docker exec -it $(docker inspect --format '{{.Status.ContainerStatus.ContainerID}}' $(docker service ps --filter desired-state=running --format '{{.ID}}' iis2)) powershell Invoke-WebRequest http://iis1/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment