What I'm trying to do, to create a Docker container with apt-mirror which also uses Cerbot for Letsencrypt with nginx.
There is an image for nginx/certbot but it's based on Alpine Linux (=no aptmirror package available, right?).
So I've tried the official EFF tutorial but get an error.
invoke-rc.d: could not determine current runlevel invoke-rc.d: policy-rc.d denied execution of force-reload. Failed to open connection to "system" message bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory Setting up packagekit-tools (1.1.5-2+deb9u1) ... Processing triggers for libc-bin (2.24-11+deb9u4) ... Processing triggers for ca-certificates (20161130+nmu1+deb9u1) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. Processing triggers for dbus (1.10.26-0+deb9u1) ... Processing triggers for systemd (232-25+deb9u11) ... Error: 'universe' invalid
While I see the point you can't run everything in Docker, still while there are also official certbot Docker distributions, this is a little bit puzzling.
FROM nginx:stable RUN apt-get update &&\ apt-get install -y cron software-properties-common &&\ add-apt-repository universe &&\ add-apt-repository ppa:certbot/certbot &&\ apt-get update &&\ apt-get install certbot python-certbot-nginx RUN certbot --nginx &&\ certbot renew --dry-run CMD [ "sh", "-c", "nginx" ]