Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Latest commit

 

History

History
48 lines (35 loc) · 1.01 KB

File metadata and controls

48 lines (35 loc) · 1.01 KB

init-certificates

Docker image for producing TLS certificates for use by a Docker server/client.

This is a poor imitation of docker-machine regenerate-certs, as a shell script, run in the nginx Docker image.

Example Usage

Generate certificates:

docker run --rm --volume $PWD:/certs \
  restyled/init-certificates -H {hostname} -i {ip}

Start the daemon:

sudo dockerd \
  --tlsverify \
  --tlscacert=ca.pem \
  --tlscert=server_cert.pem \
  --tlskey=server_key.pem \
  -H=0.0.0.0:2376

Connect with a client

$ mkdir -pv ~/.docker
$ sudo cp -v {ca,cert,key}.pem ~/.docker
$ sudo chown $USER:$USER ~/.docker/*.pem
$ export DOCKER_TLS_VERIFY=1
$ export DOCKER_HOST=tcp://{hostname or ip}:2376
docker ps

Caveat

This is not intended to make robust certificates for use in your broader infrastructure. I use it to make a CA and Certificates local to a single, ephemeral "build box". That said, if anyone wants to make this more secure, PRs welcome.


LICENSE