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 in Docker by Riya
41 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 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 in Docker by Sirajul
• 37,930 points
33 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,110 points

edited Oct 16, 2018 by lina 5,334 views
0 votes
1 answer
0 votes
1 answer
0 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
• 56,920 points
224 views
+1 vote
11 answers

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

Use bash with -c docker exec -it CONTAINER_ID ...READ MORE

answered Dec 10, 2018 in Docker by Kiyara
123,662 views