I would like to do this :
curl --insecure --cert cert.pem --key key.pem https://192.168.30.53:2376/images/json
I have 2 VMs on a server with a virtual network (NAT) :
mh-keystore 192.168.2.103 -> 192.168.30.52
swarm-master 192.168.2.100 -> 192.168.30.53
Local NAT ips are linked to external ip. I can access the machines by SSH.
docker-machine is installed on mh-keystore. I use the generic driver to deploy docker to the swarm-master
When I call the the api from the docker-machine host (mh-keystore) it works :
$curl --insecure --cert .docker/machine/certs/cert.pem --key .docker/machine/certs/key.pem https://192.168.2.100:2376/images/json
[{"Id":"6b40fe7724bd29107f6182ca2befec011cdf524b23ebc4c9a33591d6b7aea4ee","ParentId":"2b4c55187a27a43f6c5aebab707e75cffee14f7c3cc02e4f74429992bd5f7db2","RepoTags":["swarm:latest"],"RepoDigests":[],"Created":1446581252,"Size":0,"VirtualSize":15602184,"Labels":null},{"Id":"ded5e192a685b2c5f048ea98ca24f4c8c4dccc012185448a0247b49b24645007","ParentId":"8f17e9411cf6e7467e630b369a0216b582a8a811901befc800de41537bde1f04","RepoTags":["docker/whalesay:latest"],"RepoDigests":[],"Created":1432591463,"Size":0,"VirtualSize":247049019,"Labels":{}}]
So I want to call it from my own computer.
curl --insecure --cert cert.pem --key key.pem https://192.168.30.53:2376/images/json
curl --insecure --cert cert.pem --key key.pem https://192.168.30.52:2376/images/json
Curl doesn't respond.
The key and cert are the copy of the mh-keystore ones. (I don't know if it's the good solution)
What is wrong ?
Thank you
Problem was my school's firewall, I bypass it using iptables to use the 8080 port :
iptables -t nat -A DOCKER ! -i docker0 -p tcp -m tcp --dport 8080 -j DNAT --to-destination 172.17.0.2:3376