github.com/slene/docker@v1.8.0-rc1/docs/articles/https/Makefile (about)

     1  
     2  HOST:=boot2docker
     3  
     4  makescript:
     5  	./parsedocs.sh > make_certs.sh
     6  
     7  build: clean makescript
     8  	docker build -t makecerts .
     9  
    10  cert: build
    11  	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
    12  
    13  certs: cert
    14  
    15  run:
    16  	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
    17  
    18  client:
    19  	sudo docker --tls --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem   -H=$(HOST):6666 version
    20  	sudo docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem   -H=$(HOST):6666 info
    21  	sudo curl https://$(HOST):6666/images/json --cert ./cert.pem --key ./key.pem --cacert ./ca.pem
    22  
    23  clean:
    24  	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