Hello. I’m trying to get certbot and pebble working locally with Docker, but running into an issue with certbot trying to create a path with a colon “:” in it, which is being rejected.
My docker-compose.yml looks like this:
nginx:
image: nginx:1.17.10
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
certbot:
image: certbot/certbot:v1.4.0
entrypoint: "certbot certonly --debug --webroot -w /var/www/certbot --email test@test.com -d test.com --rsa-key-size 4096 --agree-tos --force-renewal --non-interactive --server http://pebble:14000/dir --no-verify-ssl"
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
pebble:
image: letsencrypt/pebble:v2.3.0
command: rm -rf /etc/letsencrypt/accounts/ && pebble -config /config/pebble-config.json
ports:
- 14000:14000 # ACME port
- 15000:15000 # Management port
environment:
- PEBBLE_VA_NOSLEEP=1
volumes:
- ./pebble/config:/config
- ./pebble/certs:/certs
pebble-config.json is as follows:
{
"pebble": {
"listenAddress": "0.0.0.0:14000",
"managementListenAddress": "0.0.0.0:15000",
"certificate": "/certs/localhost/cert.pem",
"privateKey": "/certs/localhost/key.pem",
"httpPort": 5002,
"tlsPort": 5001,
"ocspResponderURL": "",
"externalAccountBindingRequired": false
}
}
When I bring up the container, the certbot container emits the following error:
Plugins selected: Authenticator webroot, Installer None
Exiting abnormally:
Traceback (most recent call last):
File "/usr/local/bin/certbot", line 11, in <module>
load_entry_point('certbot', 'console_scripts', 'certbot')()
File "/opt/certbot/src/certbot/certbot/main.py", line 15, in main
return internal_main.main(cli_args)
File "/opt/certbot/src/certbot/certbot/_internal/main.py", line 1347, in main
return config.func(config, plugins)
File "/opt/certbot/src/certbot/certbot/_internal/main.py", line 1217, in certonly
le_client = _init_le_client(config, auth, installer)
File "/opt/certbot/src/certbot/certbot/_internal/main.py", line 603, in _init_le_client
acc, acme = _determine_account(config)
File "/opt/certbot/src/certbot/certbot/_internal/main.py", line 503, in _determine_account
account_storage = account.AccountFileStorage(config)
File "/opt/certbot/src/certbot/certbot/_internal/account.py", line 147, in __init__
util.make_or_verify_dir(config.accounts_dir, 0o700, self.config.strict_permissions)
File "/opt/certbot/src/certbot/certbot/util.py", line 173, in make_or_verify_dir
filesystem.makedirs(directory, mode)
File "/opt/certbot/src/certbot/certbot/compat/filesystem.py", line 211, in makedirs
return os.makedirs(file_path, mode)
File "/usr/local/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/local/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
OSError: [Errno 71] Protocol error: '/etc/letsencrypt/accounts/pebble:14000'
It appears that the OS can’t create a folder named “pebble:14000” because it contains a colon “:” in the folder name.
I was able to confirm this by a simple test on the Ubuntu command line by running
mkdir a:1
,
which will give the same error:
mkdir: cannot create directory ‘a:1’: Protocol error
Also, it seems like it’s getting that folder name/value from the “–server http://pebble:14000/dir” param that is being passed into the “certbot certonly” entrypoint/command on the “certbot” container.
Is there any way to specify the name of the folder that gets created under “accounts/”?
Any help is greatly appreciated. Thank you.