Manikumar Nune
Manikumar Nune

Reputation: 21

Custom DNS record and SSL certificate in docker container

I am facing a issue with self signed certificate and DNS record in hosts file inside docker container. We have multiple Linux servers with docker swarm running. There was a docker service where I need to copy the self signed certificate and create a DNS record manually with docker exec all the time when ever service is restarting. There was a mapped volume for the docker service. How can I map container DNS file(/etc/hosts) and /usr/local/share/ca-certificates to have these in mapped place so that there will be no issues if the container re-start.

Upvotes: 1

Views: 922

Answers (1)

Chris Becke
Chris Becke

Reputation: 36016

Use docker configs.

Something like :-

docker config create my_public-certificate-v1 public.crt.
docker service create --config src=my_public-certificate-v1,target=/usr/local/share/ca-certificates/example.com.crt ...

Upvotes: 0

Related Questions