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
47 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
• 40,980 points
41 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,160 points

edited Oct 16, 2018 by lina 5,722 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,960 points
254 views
+1 vote
11 answers