2015-01-06 19:32:23 -05:00
HOST := boot2docker
makescript :
./parsedocs.sh > make_certs.sh
2015-02-11 21:21:09 -05:00
build : clean makescript
2015-01-06 19:32:23 -05:00
docker build -t makecerts .
cert : build
2015-02-11 21:21:09 -05:00
docker run --rm -it -v $( CURDIR) :/data -e HOST = $( HOST) -e YOUR_PUBLIC_IP = $( shell ip a | grep "inet " | sed "s/.*inet \([0-9.]*\)\/.*/\1/" | xargs echo | sed "s/ /,IP:/g" ) makecerts
2015-01-06 19:32:23 -05:00
certs : cert
run :
2015-01-22 21:17:55 -05:00
sudo docker -d -D --tlsverify --tlscacert= ca.pem --tlscert= server-cert.pem --tlskey= server-key.pem -H= 0.0.0.0:6666 --pidfile= $( pwd ) /docker.pid --graph= $( pwd ) /graph
2015-01-06 19:32:23 -05:00
client :
2015-01-22 21:17:55 -05:00
sudo docker --tls --tlscacert= ca.pem --tlscert= cert.pem --tlskey= key.pem -H= $( HOST) :6666 version
sudo docker --tlsverify --tlscacert= ca.pem --tlscert= cert.pem --tlskey= key.pem -H= $( HOST) :6666 info
2015-02-11 21:21:09 -05:00
sudo curl https://$( HOST) :6666/images/json --cert ./cert.pem --key ./key.pem --cacert ./ca.pem
2015-01-06 19:32:23 -05:00
clean :
2015-02-11 21:21:09 -05:00
rm -f ca-key.pem ca.pem ca.srl cert.pem client.csr extfile.cnf key.pem server-cert.pem server-key.pem server.csr extfile.cnf