Certbot in docker


I want to automate the generation certs to docker
docker run -it -v $(PWD):/etc/letsencrypt/live \ certbot/dns-dnsimple \ certonly \ --email ex@ex.com \ --agree-tos \ --dns-dnsimple \ --dns-dnsimple-credentials /etc/letsencrypt/live/dnsimple.ini \ --no-eff-email \ -d "*.ex.com" -d ex.com

and i have in my directory on the local host
16:42 cert.pem -> ../../archive/ex.com/cert1.pem
fullchain.pem -> ../../archive/ex.com/fullchain1.pem
Now i use docker cp -L docker-name:/etc/letsencrypt/live/ex.com/fullchain.pem
But i want to remove container when it finishes.

Question: how to get certificate files on my local host via docker?


The simplest solution (which is usually good for long-term) should be always keeping the “contents” of the entire /etc/letsencrypt folder; even after the docker container is “destroyed” or even “replaced”.

There may be more than one way to do that.
I suggest using a “common” path (outside of that docker image) that other systems can be allowed access to for all LE/certbot “app” information and files.

closed #3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.