Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
Configure docker run to use ssl / https / tls

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?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The dockerd tls options are for configuring the daemon to listen on a network port instead of, or in addition to, docker.sock. This is for docker API requests, not to reach your application, and I don't believe what you are asking for.

It sounds like you are looking for TLS termination and forwarding the request to your application in HTTP. For that, there are various reverse proxies that can run in front of your container. Examples include nginx, traefik, haproxy, and I believe most, if not all, feature TLS termination. They do tend to focus on layer 7 and the HTTP protocol, so if you have other types of protocols, you may be forced mounting the TLS credentials into your container, preferably as a secret, or at the worst, a read only volume.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!