专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

theohbrothers/docker-certbot-dns-cron Docker 镜像 - 轩辕镜像

docker-certbot-dns-cron
theohbrothers/docker-certbot-dns-cron
theohbrothers
Dockerized Certbot with DNS Plugins, with cron, deploy, email alert capabilities 🐳
0 次下载
🙃 代码没问题,结果发布失败在拉镜像
镜像简介版本下载
🙃 代码没问题,结果发布失败在拉镜像

docker-certbot-dns-cron

![github-actions]([] ![github-release]([] ![docker-image-size]([***]

Dockerized certbot with DNS Plugins, based on official certbot docker images, with cron, deploy, email alert capabilities.

It signs wildcards certificates for domains. For instance, the DNS Names for an obtained certificate for example.com would be: example.com, *.example.com.

All Certbot plugins are supported: cloudflare, cloudxns, digitalocean, dnsimple, dnsmadeeasy, google, linode, luadns, nsone, ovh, rfc2136, route53

Deprecation notice

The present application is a 4-step tool for automating ACME certificate renewal using certbox for a container orchestrator like docker standalone or docker swarm.

However, step 2., 3., and 4. may be solved by using already existing tools, for instance:

  • Copying certs to another service can be done by sharing a volume or by some other means
  • Reloading another service by sending a signal can be done in many other ways which are more secure than doing it over /var/run/docker.sock
  • Notification can be done in many other ways other than email

Since there only remains step 1. to solve, there is no benefit to using this application. The certbot tool itself constantly evolves, and it makes no sense to maintain a wrapping entrypoint script around it.

Hence, it is simpler to just use the official certbot docker images. If a cron is needed, create a crontab in /etc/crontabs/<user> and run crond.

Tags

Each variant is Certbot DNS provider plugin image.

TagPlugin nameDockerfile Build Context
:v1.12.0-cloudflare, :latestcertbot-dns-cloudflareView
:v1.11.0-cloudflarecertbot-dns-cloudflareView
:v1.10.1-cloudflarecertbot-dns-cloudflareView
:v1.9.0-cloudflarecertbot-dns-cloudflareView
:v1.12.0-cloudxnscertbot-dns-cloudxnsView
:v1.11.0-cloudxnscertbot-dns-cloudxnsView
:v1.10.1-cloudxnscertbot-dns-cloudxnsView
:v1.9.0-cloudxnscertbot-dns-cloudxnsView
:v1.12.0-digitaloceancertbot-dns-digitaloceanView
:v1.11.0-digitaloceancertbot-dns-digitaloceanView
:v1.10.1-digitaloceancertbot-dns-digitaloceanView
:v1.9.0-digitaloceancertbot-dns-digitaloceanView
:v1.12.0-dnsimplecertbot-dns-dnsimpleView
:v1.11.0-dnsimplecertbot-dns-dnsimpleView
:v1.10.1-dnsimplecertbot-dns-dnsimpleView
:v1.9.0-dnsimplecertbot-dns-dnsimpleView
:v1.12.0-dnsmadeeasycertbot-dns-dnsmadeeasyView
:v1.11.0-dnsmadeeasycertbot-dns-dnsmadeeasyView
:v1.10.1-dnsmadeeasycertbot-dns-dnsmadeeasyView
:v1.9.0-dnsmadeeasycertbot-dns-dnsmadeeasyView
:v1.12.0-googlecertbot-dns-googleView
:v1.11.0-googlecertbot-dns-googleView
:v1.10.1-googlecertbot-dns-googleView
:v1.9.0-googlecertbot-dns-googleView
:v1.12.0-linodecertbot-dns-linodeView
:v1.11.0-linodecertbot-dns-linodeView
:v1.10.1-linodecertbot-dns-linodeView
:v1.9.0-linodecertbot-dns-linodeView
:v1.12.0-luadnscertbot-dns-luadnsView
:v1.11.0-luadnscertbot-dns-luadnsView
:v1.10.1-luadnscertbot-dns-luadnsView
:v1.9.0-luadnscertbot-dns-luadnsView
:v1.12.0-nsonecertbot-dns-nsoneView
:v1.11.0-nsonecertbot-dns-nsoneView
:v1.10.1-nsonecertbot-dns-nsoneView
:v1.9.0-nsonecertbot-dns-nsoneView
:v1.12.0-ovhcertbot-dns-ovhView
:v1.11.0-ovhcertbot-dns-ovhView
:v1.10.1-ovhcertbot-dns-ovhView
:v1.9.0-ovhcertbot-dns-ovhView
:v1.12.0-rfc2136certbot-dns-rfc2136View
:v1.11.0-rfc2136certbot-dns-rfc2136View
:v1.10.1-rfc2136certbot-dns-rfc2136View
:v1.9.0-rfc2136certbot-dns-rfc2136View
:v1.12.0-route53certbot-dns-route53View
:v1.11.0-route53certbot-dns-route53View
:v1.10.1-route53certbot-dns-route53View
:v1.9.0-route53certbot-dns-route53View

Usage

Example: Not using Swarm Secrets

This example signs 2 wildcard certificates, one certificate for example.com, and one for ns.example.com :

  1. example.com, *.example.com
  2. ns.example.com, *.ns.example.com
sh
docker service create --name certbot-dns-cron \
    -e STAGING=1 \
    -e 'DOMAINS=example.com;ns.example.com' \
    -e PLUGIN_DNS_PROVIDER=cloudflare \
    -e PLUGIN_DNS_CREDENTIALS_FILE=/etc/letsencrypt/certbot_dns_cloudflare_credentials.ini \
    -e PLUGIN_DNS_PROPAGATION_SECONDS=10 \
    --mount type=bind,source=/var/run/certbot_dns_cloudflare_credentials.ini,target=/etc/letsencrypt/certbot_dns_cloudflare_credentials.ini,readonly \
    --mount type=bind,source=/path/to/data/certs/,target=/certs \
    --mount type=bind,source=/path/to/data/letsencrypt,target=/etc/letsencrypt \
    --replicas=1 \
    theohbrothers/docker-certbot-dns-cron:v1.12.0-cloudflare

Contents of secret certbot_dns_cloudflare_credentials.ini

ini
# Cloudflare API credentials used by Certbot
dns_cloudflare_email = ***
dns_cloudflare_api_key = 0123456789abcdef0123456789abcdef01234567
Example: Using Swarm Secrets

This example signs 2 wildcard certificates, one certificate for example.com, and one for ns.example.com :

  1. example.com, *.example.com
  2. ns.example.com, *.ns.example.com

LetsEncrypt expiry notification emails will be sent to: ***

sh
docker service create --name certbot-dns-cron \
    -e STAGING=1 \
    --secret certbot_domains.txt \
    --secret certbot_dns_cloudflare_credentials.ini \
    -e PLUGIN_DNS_PROVIDER=cloudflare \
    -e PLUGIN_DNS_CREDENTIALS_FILE=/run/secrets/certbot_dns_cloudflare_credentials.ini \
    -e PLUGIN_DNS_PROPAGATION_SECONDS=10 \
    --mount type=bind,source=/path/to/data/certs/,target=/certs \
    --mount type=bind,source=/path/to/data/letsencrypt,target=/etc/letsencrypt \
    --replicas=1 \
    theohbrothers/docker-certbot-dns-cron:v1.12.0-cloudflare

Contents of secret certbot_dns_cloudflare_credentials.ini

ini
# Cloudflare API credentials used by Certbot
dns_cloudflare_email = ***
dns_cloudflare_api_key = 0123456789abcdef0123456789abcdef01234567

Contents of secret certbot_domains.txt

txt
example.com
ns.example.com
Full Example: Using Swarm Secrets

This example will sign, deploy certs, reload a target container (requires mounting the docker.sock), and email a summary report about the success of those tasks (requires email credential secrets). Four wildcard certificates will be obtained:

  • example.com, *.example.com
  • ns.example.com, *.ns.example.com
  • example2.com, *.example2.com
  • ns.example2.com, *.ns.example2.com

LetsEncrypt expiry notification emails will be sent to: ***

sh
docker service create --name certbot-dns-cron \
    -e STAGING=1 \
    -e PLUGIN_DNS_PROVIDER=cloudflare \
    -e PLUGIN_DNS_CREDENTIALS_FILE=/run/secrets/certbot_dns_cloudflare_credentials.ini \
    -e PLUGIN_DNS_PROPAGATION_SECONDS=10 \
    --secret certbot_domains.txt \
    --secret certbot_dns_cloudflare_credentials.ini \
    -e DOMAIN_ADMIN_EMAIL_LOCALPART=admin
    \
    -e DEPLOY_CERTS=1 \
    \
    -e TARGET_CONTAINER_NAME=nginx-proxy_docker-gen \
    \
    -e EMAIL_REPORT=1 \
    --secret certbot_email_from \
    --secret certbot_email_to \
    --secret certbot_email_user \
    --secret certbot_email_password \
    --secret certbot_email_smtp_server \
    --secret certbot_email_smtp_port \
    \
    --mount type=bind,source=/path/to/data/certs/,target=/certs \
    --mount type=bind,source=/path/to/data/letsencrypt,target=/etc/letsencrypt \
    --mount type=bind,source=/var/run/docker.sock,target=/tmp/docker.sock \
    --replicas=1 \
    theohbrothers/docker-certbot-dns-cron:v1.12.0-cloudflare

Contents of secret certbot_domains.txt

txt
example.com
ns.example.com
example2.com
ns.example2.com

Contents of secret certbot_dns_cloudflare_credentials.ini

ini
# Cloudflare API credentials used by Certbot
dns_cloudflare_email = ***
dns_cloudflare_api_key = 0123456789abcdef0123456789abcdef01234567

Contents of secret certbot_email_from

txt
***

Contents of secret certbot_email_to

txt
***

Contents of secret certbot_email_user

txt
***

Contents of secret certbot_email_password

txt
myPassword

Contents of secret certbot_email_smtp_server

txt
smtp.example.com

Contents of secret certbot_email_smtp_port

txt
587

Environment variables

Environment variables are used to configure various stages of the automation process.

1. certbot Certificate Signing stage
NameDefault valueDescriptionCorresponds to certbot argument
STAGING0Whether to use production or staging LetsEncrypt endpoint. 0 for production, 1 for staging
RSA_KEY_SIZE4096Size of the RSA key.--rsa-key-size
DOMAINS""Domains (delimited by ';' )--domains, -d
DOMAINS_FILE4096Same as DOMAINS, but this should point to a file. Domains should be delimited by "\n". Useful when using secrets.--domains, -d
DOMAIN_ADMIN_EMAIL_LOCALPARTadminAdmin Email's Local-part for LetsEncrypt expiry-notification emails. The final email will be <DOMAIN_ADMIN_EMAIL_LOCALPART>@domain.com--email, -m
PLUGIN_DNS_PROVIDER""DNS Provider. Valid values are: cloudflare, cloudxns, digitalocean, dnsimple, dnsmadeeasy, google, linode, luadns, nsone, ovh, rfc2136, route53--dns-<PLUGIN_DNS_PROVIDER>
PLUGIN_DNS_CREDENTIALS_FILE""Path to the dns credentials file--dns-<PLUGIN_DNS_PROVIDER>-credentials.
PLUGIN_DNS_PROPAGATION_SECONDScertbot plugin default, check plugin documentationThe number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record.--dns-<PLUGIN_DNS_PROVIDER>-propagation-seconds.
2. Deploy stage
NameDefault valueDescription
DEPLOY_CERTS""Whether to deploy the signed cert, key, fullchain cert, and chain cert. This copies /etc/letsencrypt/live/<domain>/privkey.pem to /certs/<domain>.key, /etc/letsencrypt/live/<domain>/cert.pem to /certs/<domain>.crt, /etc/letsencrypt/live/<domain>/fullchain.pem to /certs/<domain>.fullchain.pem, and /etc/letsencrypt/live/<domain/chain.pem to /certs/<domain>.chain.pem. Omit environment variable to disable deploy
3. Reload stage
NameDefault valueDescription
TARGET_CONTAINER_NAME""Container name to reload (with SIGHUP) after signing and obtaining cert. In Swarm mode, specify <stack><service> and any container with name starting with <stack><service> will be sent a signal. Only one container name may be matched, so ensure this is as unique as possible. Omit environment variable to disable reload
4. Email notification stage
NameDefault valueDescription
EMAIL_REPORT""Whether to email the summary report on successful cert-signing, deployment, and reloading of target container. Omit environment variable to disable email
EMAIL_FROM""Email sender address
EMAIL_TO""Email receipient address
EMAIL_USER""SMTP sender account user
EMAIL_PASSWORD""SMTP sender account password
SMTP_SERVER""SMTP server DNS / hostname / IP address. E.g. smtp.example.com, 1.2.3.4
SMTP_PORT""SMTP server port. E.g. 587, 465
If using Swarm Secrets

Instead of specifying your email credentials in the docker-stack.yml, use environment variables suffixed with _FILE, each pointing to Swarm Secrets' mountpoints /run/secrets/<secret_name>. These files will be read to obtain the email credentials.

NameDefault valueDescription
EMAIL_FROM_FILE/run/secrets/certbot_email_fromEmail sender address
EMAIL_TO_FILE/run/secrets/certbot_email_toEmail receipient address
EMAIL_USER_FILE/run/secrets/certbot_email_userSMTP sender account user
EMAIL_PASSWORD_FILE/run/secrets/certbot_email_passwordSMTP sender account password
SMTP_SERVER_FILE/run/secrets/certbot_email_smtp_serverSMTP server DNS / hostname / IP address. E.g. smtp.example.com, 1.2.3.4
SMTP_PORT_FILE/run/secrets/certbot_email_smtp_portSMTP server port. E.g. 587, 465

Cron interval

By default, the cron invokes the main script every hour.

Script usage

Manually sign a certificate

To do so, invoke the main script, passing domain(s) as arguments.

If a certificate for a given domain doesn't yet exist, a new certificate will be obtained. If a certificate for a given domain is not due for renewal, certbot shows a message that no renewal is done.

sh
docker exec -it "$container_name_or_id" sh -c '/app/scripts/signcert-deploy-sendmail.sh example.com'

# For multiple domains
docker exec -it "$container_name_or_id" sh -c '/app/scripts/signcert-deploy-sendmail.sh example.com example2.com example3.com'

To force certificate renewal even if the certificate is not yet due for renewal, use the --force flag:

sh
docker exec -it "$container_name_or_id" sh -c '/app/scripts/signcert-deploy-sendmail.sh --force example.com'

# For multiple domains
docker exec -it "$container_name_or_id" sh -c '/app/scripts/signcert-deploy-sendmail.sh --force example.com example2.com example3.com'
Manually deploy a signed certificate

This can either be done by using the provided script deploy.sh

sh
docker exec -it "$container_name_or_id" sh -c '/app/scripts/deploy.sh example.com'
Manually remove a certificate

This can either be done by using the provided script removecert.sh, or manually deleting the domain folder in the letsencrypt data folder. For example.com, delete the folder named example.com

sh
docker exec -it "$container_name_or_id" sh -c '/app/scripts/removecert.sh example.com'
Read a certificate
sh
docker exec -it "$container_name_or_id" sh -c '/app/scripts/readcert.sh example.com'

Script behaviour

certbot Certificate Signing stage

Assuming you passed in the necessary environment variables, renewing certs would be as simple as invoking the main script, whether through docker exec, or directly inside the container. The script reads environment variables each time it is invoked.

Deploy stage

The script copies each successfully signed domain certificate, key, full chain, and chain certificates to the folder /certs.

To disable this stage, omit the environment variable DEPLOY_CERTS.

Reload stage

The script sends a SIGHUP (1) to a container with name starting with TARGET_CONTAINER_NAME.

When Swarm Mode is used, all services go by the naming convention <stack><service>. <stack> is the name given when using docker stack up, and <service> is the service key in the docker-compose.yml or docker-stack.yml. If a container name starts with <stack><service>, ignoring the suffix, that container is sent the signal. As an example, if the value of TARGET_CONTAINER_NAME variable is mystack_docker-gen, the service called mystack_docker-gen.1.jb2xwgp3ktnmsmp1eo31563jw is sent the reload signal. The signal is sent to one container only; if multiple containers names match mystack_docker-gen, no signal is sent. Therefore keep the container name as unique as possible.

Mounting the /var/run/docker.sock is necessary for reloading to take place.

To disable this stage, omit the environment variable TARGET_CONTAINER_NAME.

Email notification stage

This sends a summarized report of all the previous steps and their success status. Only one email is sent each time the script is invoked.

No email is sent in these cases:

  1. The email functionality is disabled by omitting EMAIL_REPORT
  2. One or more email credentials were not specified, among: EMAIL_FROM, EMAIL_TO, EMAIL_USER, EMAIL_PASSWORD, SMTP_SERVER, SMTP_PORT
  3. The email credentials were wrong
  4. All the given domains' certificates are not due for renewal

Assuming all variables are set correctly, as long as one certificate is obtained / renewed, a summary report will be sent.

To disable this stage, omit the environment variable EMAIL_REPORT.

Development

Requires Windows powershell or pwsh.

powershell
# Install Generate-DockerImageVariants module: [***]
Install-Module -Name Generate-DockerImageVariants -Repository PSGallery -Scope CurrentUser -Force -Verbose

# Edit ./generate templates

# Generate the variants
Generate-DockerImageVariants .
查看更多 docker-certbot-dns-cron 相关镜像 →
certbot/certbot logo
certbot/certbot
这是电子前哨基金会(EFF)Certbot工具的官方版本,用于从非营利性证书颁发机构Let's Encrypt获取TLS/SSL证书,该工具旨在自动化证书的获取、安装及更新流程,帮助网站管理员轻松实现HTTPS加密,保障网络通信安全,是目前广泛使用的免费SSL证书管理工具之一。
666100M+ pulls
上次更新:未知
certbot/dns-ovh logo
certbot/dns-ovh
EFF的Certbot官方构建版本,包含用于通过OVH进行DNS验证挑战的插件。
31M+ pulls
上次更新:未知
certbot/dns-cloudflare logo
certbot/dns-cloudflare
官方构建的EFF Certbot,包含用于通过Cloudflare进行DNS验证的插件,可处理DNS挑战以获取SSL/TLS证书。
905M+ pulls
上次更新:未知
certbot/dns-route53 logo
certbot/dns-route53
EFF Certbot的官方构建版本,包含用于通过Amazon Route 53执行DNS验证的插件,适用于获取和管理SSL证书。
325M+ pulls
上次更新:未知
airbyte/cron logo
airbyte/cron
暂无描述
210M+ pulls
上次更新:未知
certbot/dns-digitalocean logo
certbot/dns-digitalocean
EFF的Certbot官方构建版,包含用于通过DigitalOcean进行DNS验证挑战的插件。
211M+ pulls
上次更新:未知

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
theohbrothers/docker-certbot-dns-cron
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.