Docker Community Forums

Share and learn in the Docker community.

What's the better practise for sharing the Let's encrypt Certificate files to the containers


(Losangles) #1

I tried to share the Letsencrypt SSL certificate file which is on the folder /etc/letsencrypt/live/mydomain.com/ of the host,
I tried share them to containers one is Tomcat,another is Apache+PHP,it doesn’t work

I tried
docker run -it -d -v /etc/letsencrypt/live/mydomain.com/:/etc/letsencrypt/live/mydomain.com/:rw --name tomcat8 tomcat:8.5-jre8

and tried to verify the certificate files within the containers,even though it’s existed already,however it didn’t verify passed yet
root@fe01e82fc841:/etc/letsencrypt/live/mydomain.com/# openssl verify privkey.pem
Can’t open privkey.pem for reading, No such file or directory
139861614040320:error:02001002:system library:fopen:No such file or directory:…/crypto/bio/bss_file.c:74:fopen(‘privkey.pem’,‘r’)
139861614040320:error:2006D080:BIO routines:BIO_new_file:no such file:…/crypto/bio/bss_file.c:81:
unable to load certificate

any idea what wrong I have done?any idea for better solution?thanks