Use a TLS certificate - Docker

0 votes
I have already created a TLS certificate. Now I would like to tell my docker, how to use it. How do I do that?
Jul 31, 2019 in Docker by Riya
824 views

1 answer to this question.

0 votes

You do this by creating a drop in systemd unit to modify the existing Docker systemd unit.

Create the file custom.conf in /etc/systemd/system/docker.service.d/:

If you want to restrict local users from using the docker unix socket remove the second -H command line option, if you already have a custom drop in unit you can add the -H and –tls* arguments to it.

[Service]
Environment="DOCKER_OPTS=-H=0.0.0.0:2376 -H unix:///var/run/docker.sock --tlsverify --tlscacert=/etc/docker/ssl/ca.pem --tlscert=/etc/docker/ssl/cert.pem --tlskey=/etc/docker/ssl/key.pem"

Reload systemd and the Docker service:

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
answered Jul 31, 2019 by Ajay

Related Questions In Docker

0 votes
1 answer

How to configure my docker container to use a different logging driver?

When you start a docker container, you ...READ MORE

answered Jul 4, 2019 in Docker by Sirajul
• 59,230 points
1,366 views
+1 vote
0 answers

How can I map a docker location to my Jenkins workspace so that I can use the files in my Jenkins

Hey guys, I was trying to execute few ...READ MORE

Feb 25, 2020 in Docker by dineshkumar
• 130 points
4,936 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,719 views
+15 votes
19 answers

How can I run a ‘docker exec’ command inside a docker container?

you can run any command in a ...READ MORE

answered Dec 10, 2018 in Docker by Pramiti
1,229,602 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP