I am currently running on Docker
1.12.0-rc4. I am wondering how I can interlink services between each other.
Assuming I have a 2 server Elastic cluster which does not provide authentication, connecting to each other via an overlay network. (Note: there may be still a bug in rc4 which prevent this from working correctly)
docker service create \ --name elastic \ --replicas=2 \ --publish 9200 \ --publish 9300 \ --network NetworkElastic \ elasticsearch \ -Ddiscovery.zen.ping.unicast.hosts=elastic
Now I want to put a proxy on each server in front of Elastic to enable authentication
docker service create \ --name proxy9200 \ --replicas=2 \ --publish 9200:80/tcp \ --network NetworkElastic \ --env PASSTHRU_DESTINATION=http://elastic:9200 \ --env PASSTHRU_USERNAME=elastic \ --env "PASSTHRU_PASSWORD=my-pass" \ collinsongroup/nginxpasswordproxy
How would I configure the nginx container to forward to elastic service port 9200? Best case to stay on the same server to not generate too much network traffic. Parameter
--link does not exist for services.
I think the swarm create documentation could be expanded a bit about this.