Ubuntu 18.04 docker The 'certbot' distribution was not found and is required by the application


#1

I ran this command: sudo docker run -it --rm --name certbot -v “/etc/letsencrypt:/etc/letsencrypt” -v “/var/lib/letsencrypt:/var/lib/letsencrypt” -v “/opt:/opt” certbot/dns-dnsmadeeasy certonly --dns-dnsmadeeasy --dns-dnsmadeeasy-credentials /opt/dnsmadeeasy -d mydomain.com --server https://acme-v02.api.letsencrypt.org/directory --rsa-key-size 4096

It produced this output: Traceback (most recent call last):
File “/usr/local/bin/certbot”, line 6, in
from pkg_resources import load_entry_point
File “/usr/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 3098, in
@_call_aside
File “/usr/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 3082, in _call_aside
f(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 3111, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 573, in _build_master
ws.require(requires)
File “/usr/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 891, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 777, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘certbot’ distribution was not found and is required by the application

The operating system my web server runs on is (include version): ubuntu 18.04 lts


Using CertBot with Docker and `/opt/` directory
#2

Why? No data is stored in this directory, and it’s probably causing your breakage.

Edit: I just noticed you’re storing your DNSMadeEasy credentials in /opt. Not a good idea, just place it in /etc/letsencrypt/ (or literally anywhere that isn’t used for other purposes) and chmod it to 0600.


#3

My credentials are stored there (;

sudo docker run -it --rm --name certbot -v “/etc/letsencrypt:/etc/letsencrypt” -v “/var/lib/letsencrypt:/var/lib/letsencrypt” -v “/opt/dnsmadeeasy:/opt/dnsmadeeasy” certbot/dns-dnsmadeeasy certonly --dns-dnsmadeeasy --dns-dnsmadeeasy-credentials /opt/dnsmadeeasy -d mydomain.com --server https://acme-v02.api.letsencrypt.org/directory --rsa-key-size 4096

seems to work

EDIT: okay I put it in /etc/letsencrypt. Made it 0400 before. For what would I need the W rights?


#4

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