Is there a way to configure docker run to use https? Something like:
docker run --https --certs xyz myimage
or do you have to configure that stuff within a Dockerfile/image? Likewise for TLS.
docker run --tls --certs xyz myimage
One advantage is we wouldn't have to copy the certs to the image - I'd rather avoid having the certs in the image and/or running container.
Although I guess the best practice is to use the -v
option to share the certs from the host into the container.
Update: after some research I found this: https://docs.docker.com/engine/security/https/
it says to start the docker domain with something like this:
dockerd --tlsverify --tlscacert=ca.pem \
--tlscert=server-cert.pem --tlskey=server-key.pem \
-H=0.0.0.0:2376
is this the right thing to do to secure all containers on the machine?