mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-04-10 17:17:32 +02:00
Page:
Run acme.sh in docker
Pages
Actalis.com CA
Blogs and tutorials
BuyPass.com CA
CA
Change of default CA to ZeroSSL
Code of conduct
DNS API Dev Guide
DNS API Structural Info description
DNS API Test
DNS alias mode
DNS manual mode
Deploy ssl certs to apache server
Deploy ssl certs to nginx
Deploy ssl to SolusVM
Donate list
Enable acme.sh log
Exit Codes
Explicitly use DOH
Google Public CA
Google Trust Services CA
Home
How to debug acme.sh
How to install
How to issue a cert
How to run on DD WRT with lighttpd
How to run on OpenWrt
How to use Amazon Route53 API
How to use Azure DNS
How to use OVH domain api
How to use Oracle Cloud Infrastructure DNS
How to use lexicon DNS API
How to use on Solaris based operating sytsems
How to use on embedded FreeBSD
Install in China
Install on Windows
Install preparations
Issue a cert from existing CSR
OVH Success
Options and Params
Preferred Chain
Profile selection
Run acme.sh in docker
SSL.com CA
Server
Simple guide to add TLS cert to cpanel
Stateless Mode
Synology NAS Guide
Synology RT1900ac and RT2600ac install guide
TLS ALPN without downtime
Usage on Tomato routers
Use DNS Exit DNS API
Using pre hook post hook renew hook reloadcmd
Using systemd units instead of cron
Utilize multiple DNS API keys
Validity
ZeroSSL.com CA
_Footer_
debug in VM
deploy to docker containers
deployhooks
dnsapi
dnsapi2
dnscheck
dnssleep
how about the private key access modes, chmod, or chown or umask
ipcert
notify
openvpn2.4.7服务端和客户端使用注意
revokecert
sudo
tlsa next key
如何安装
说明
No results
21
Run acme.sh in docker
invario edited this page 2026-02-09 18:37:26 -05:00
acme.sh 💕 docker
As one of the big docker fans, I understand that we hate installing anything on a docker host, even if it's just copying a shell script.
Automated nginx reverse proxy docker image with acme.sh for letsencrypt ssl cert: https://github.com/Neilpang/letsproxy
Deploy to a docker container and reload it: https://github.com/Neilpang/acme.sh/wiki/deploy-to-docker-containers
So, Here "acme.sh in docker" comes.
- Based on alpine, only 5MB size.
- Either run as executable or run as daemon
- Support all the command line parameters.
1. Say "Hello World"
docker run --rm neilpang/acme.sh
2. Used as an executable:
docker run --rm -it \
-v "$(pwd)/out":/acme.sh \
--net=host \
neilpang/acme.sh --issue -d example.com --standalone
You can use any commands that acme.sh supports here, other examples:
#revoke a cert
docker run --rm -it \
-v "$(pwd)/out":/acme.sh \
--net=host \
neilpang/acme.sh --revoke -d example.com
#use dns mode
docker run --rm -it \
-v "$(pwd)/out":/acme.sh \
neilpang/acme.sh --issue --dns -d example.com
#run cron job
docker run --rm -it \
-v "$(pwd)/out":/acme.sh \
--net=host \
neilpang/acme.sh --cron
Anyway, you can just invoke neilpang/acme.sh image as if it were a real shell script.
3. Run acme.sh as a docker daemon.
1. Running acme.sh as a docker daemon, so that it can handle the renewal cronjob automatically.
docker run --rm -itd \
-v "$(pwd)/out":/acme.sh \
--net=host \
--name=acme.sh \
neilpang/acme.sh daemon
Or run acme.sh by using Docker Compose.
Edit docker-compose.yml:
services:
acme-sh:
image: neilpang/acme.sh
container_name: acme.sh
volumes:
- ./out:/acme.sh
network_mode: host
command: daemon
stdin_open: true
tty: true
restart: no
Then run acme.sh:
docker compose up -d
By default, acme.sh runs as root. The provided Docker image creates a user named acme with UID/GID 1000. Users who want to run as a non-root user can add --user 1000:1000 to the above docker run command line, or user: '1000:1000' to the above docker-compose.yml.
Additional considerations for non-root
- If you are using the
dockerdeploy-hook and therefore mounting/var/run/docker.sock, you must ensure your non-root user has permission to read/write to/var/run/docker.sockby adding the user to the host's Docker GID (e.g.--group-add 999on the command line orgroup_add: 999in yourdocker-compose.yml - If you are using the
sshdeploy-hook, take note of where your.sshkeys are stored. **LE_CONFIG_HOME (/acme.sh) is used as home for this Docker image, so your keys will be stored in/acme.sh/.sshregardless of the user. Existing users: your keys may have stored in/root/.sshand need to be migrated into the proper directory where it will persist in the VOLUME. - If the
crontabis missing, one will be generated in LE_CONFIG_HOME (/acme.sh). Since this is a VOLUME, subsequent changes tocrontabmade by the user will persist. - The non-root
acmeuser (UID/GID 1000) must have proper read and write permissions to the acme.sh volume mounted at /acme.sh. Existing users: Depending on your mount type, you may have to set it manually either withchownorchmod.
2. Then you can just use docker exec to execute any acme.sh commands.
docker exec acme.sh --help
docker exec acme.sh --issue -d example.com --standalone
Yes, again, You can use any commands that acme.sh supports here.