This blog is a continuation of my previous blog on Docker Experimental Networking. In this blog, I will walk through the example mentioned in this link where experimental Docker is integrated with Compose and Swarm. I have made some modifications here and I will cover this here.
I will create 2 applications in this example using Docker Compose.
- Counter container connecting to redis container running on 2 different hosts.
- WordPress container connecting to mysql container running on 2 different hosts.
I have used AWS instead of Digitalocean. First step is to create Consul machine and start Consul server.
docker-machine create --driver=amazonec2 --amazonec2-access-key=xxx --amazonec2-secret-key=xxx --amazonec2-vpc-id=vpc-5f77c23a --amazonec2-region=us-west-2 --engine-install-url "https://experimental.docker.com" consul
docker $(docker-machine config consul) run -d \
-p "8500:8500" \
-h "consul" \
progrium/consul -server -bootstrap
Next, create 2 machines connecting both the nodes to Consul:





