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

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题轩辕镜像免费版
其他
关于我们网站地图
热门搜索:
caddy

library/caddy

Docker 官方镜像

Caddy 2是一款采用Go语言编写的功能强大、企业级就绪的开源Web服务器,其核心特性包括自动HTTPS功能,能够为网站提供便捷且安全的加密连接,适用于从个人项目到大型企业应用的各类场景,凭借轻量级架构和高效性能,成为Web服务部署的理想选择。

957 次收藏下载次数: 0状态:Docker 官方镜像维护者:Docker 官方镜像仓库类型:镜像最近更新:15 天前
轩辕镜像,快一点,稳很多。点击查看
DockerHub 官方简介
轩辕镜像中文简介
标签下载
镜像标签列表与下载命令
轩辕镜像,快一点,稳很多。点击查看

Quick reference

  • Maintained by:
    https://github.com/caddyserver/caddy-docker

  • Where to get help:
    the Caddy Community Forums

Supported tags and respective Dockerfile links

(See https://github.com/docker-library/faq#whats-the-difference-between-shared-and-simple-tags.)

Simple Tags

  • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/alpine/Dockerfile

  • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/builder/Dockerfile

  • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows/ltsc2022/Dockerfile

  • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows/ltsc2025/Dockerfile

  • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows-nanoserver/ltsc2022/Dockerfile

  • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows-nanoserver/ltsc2025/Dockerfile

  • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows-builder/ltsc2022/Dockerfile

  • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows-builder/ltsc2025/Dockerfile

Shared Tags

  • 2.11.2, 2.11, 2, latest:

    • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/alpine/Dockerfile
    • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows/ltsc2022/Dockerfile
    • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows/ltsc2025/Dockerfile
  • 2.11.2-builder, 2.11-builder, 2-builder, builder:

    • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/builder/Dockerfile
    • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows-builder/ltsc2022/Dockerfile
    • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows-builder/ltsc2025/Dockerfile
  • 2.11.2-windowsservercore, 2.11-windowsservercore, 2-windowsservercore, windowsservercore:

    • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows/ltsc2022/Dockerfile
    • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows/ltsc2025/Dockerfile
  • 2.11.2-nanoserver, 2.11-nanoserver, 2-nanoserver, nanoserver:

    • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows-nanoserver/ltsc2022/Dockerfile
    • https://github.com/caddyserver/caddy-docker/blob/03d78cdcd835a384ab5567ea2a5ffa022ce3ec3b/2.11/windows-nanoserver/ltsc2025/Dockerfile

Quick reference (cont.)

  • Where to file issues:
    https://github.com/caddyserver/caddy-docker/issues?q=

  • Supported architectures: (https://github.com/docker-library/official-images#architectures-other-than-amd64)
    https://hub.docker.com/r/amd64/caddy/, https://hub.docker.com/r/arm32v6/caddy/, https://hub.docker.com/r/arm32v7/caddy/, https://hub.docker.com/r/arm64v8/caddy/, https://hub.docker.com/r/ppc64le/caddy/, https://hub.docker.com/r/riscv64/caddy/, https://hub.docker.com/r/s390x/caddy/, https://hub.docker.com/r/winamd64/caddy/

  • Published image artifact details:
    https://github.com/docker-library/repo-info/blob/master/repos/caddy (https://github.com/docker-library/repo-info/commits/master/repos/caddy)
    (image metadata, transfer size, etc)

  • Image updates:
    https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fcaddy
    https://github.com/docker-library/official-images/blob/master/library/caddy (https://github.com/docker-library/official-images/commits/master/library/caddy)

  • Source of this description:
    https://github.com/docker-library/docs/tree/master/caddy (https://github.com/docker-library/docs/commits/master/caddy)

!https://raw.githubusercontent.com/docker-library/docs/7f3881a28c29ed29bb1a38681b95bd785a8a6da5/caddy/logo.png

What is Caddy?

Caddy 2 is a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go.

How to use this image

⚠️ A note about persisted data

Caddy requires write access to two locations: a data directory, and a configuration directory. While it's not necessary to persist the files stored in the configuration directory, it can be convenient. However, it's very important to persist the data directory.

From the docs:

The data directory must not be treated as a cache. Its contents are not ephemeral or merely for the sake of performance. Caddy stores TLS certificates, private keys, OCSP staples, and other necessary information to the data directory. It should not be purged without an understanding of the implications.

This image provides for two mount-points for volumes: /data and /config.

In the examples below, a named volume caddy_data is mounted to /data, so that data will be persisted.

Note that named volumes are persisted across container restarts and terminations, so if you move to a new image version, the same data and config directories can be re-used.

Basic Usage

The default config file simply serves files from /usr/share/caddy, so if you want to serve index.html from the current working directory:

console
$ echo "hello world" > index.html
$ docker run -d -p 80:80 \
    -v $PWD/index.html:/usr/share/caddy/index.html \
    -v caddy_data:/data \
    caddy
...
$ curl http://localhost/
hello world

To override the default https://github.com/caddyserver/dist/blob/master/config/Caddyfile, you can create one in the subfolder conf at $PWD/conf/Caddyfile and mount this folder at /etc/caddy:

console
$ docker run -d -p 80:80 \
    -v $PWD/conf:/etc/caddy \
    -v caddy_data:/data \
    caddy

⚠️ Do not mount the Caddyfile directly at /etc/caddy/Caddyfile

If vim or another editor is used that changes the inode of the edited file, the changes will only be applied within the container when the container is recreated, which is explained in detail in this Medium article. When using such an editor, Caddy's graceful reload functionality might not work as expected, as described in https://github.com/caddyserver/caddy/issues/5735#issuecomment-***.

Automatic TLS with the Caddy image

The default Caddyfile only listens to port 80, and does not set up automatic TLS. However, if you have a domain name for your site, and its A/AAAA DNS records are properly pointed to this machine's public IP, then you can use this command to simply serve a site over HTTPS:

console
$ docker run -d --cap-add=NET_ADMIN -p 80:80 -p 443:443 -p 443:443/udp \
    -v /site:/srv \
    -v caddy_data:/data \
    -v caddy_config:/config \
    caddy caddy file-server --domain example.com

The key here is that Caddy is able to listen to ports 80 and 443, both required for the ACME HTTP challenge.

See Caddy's docs for more information on automatic HTTPS support!

Building your own Caddy-based image

Most users deploying production sites will not want to rely on mounting files into a container, but will instead base their own images on caddy:

Dockerfile
# note: never use the :latest tag in a production site
FROM caddy:<version>

COPY Caddyfile /etc/caddy/Caddyfile
COPY site /srv

Adding custom Caddy modules

Caddy is extendable through the use of "modules". See [***] for full details. You can find a list of available modules on the Caddy website's download page.

You can use the :builder image as a short-cut to building a new Caddy binary:

Dockerfile
FROM caddy:<version>-builder AS builder

RUN xcaddy build \
    --with github.com/caddyserver/nginx-adapter \
    --with github.com/hairyhenderson/caddy-teapot-module@v0.0.3-0

FROM caddy:<version>

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

Note the second FROM instruction - this produces a much smaller image by simply overlaying the newly-built binary on top of the regular caddy image.

The xcaddy tool is used to https://github.com/caddyserver/caddy/blob/4217217badf220d7d2c25f43f955fdc8454f2c64/cmd/caddy/main.go#L15..L25, with the provided modules. You can specify just a module name, or a name with a version (separated by @). You can also specify a specific version (can be a version tag or commit hash) of Caddy to build from. Read more about https://github.com/caddyserver/xcaddy#command-usage.

Note that the "standard" Caddy modules (https://github.com/caddyserver/caddy/tree/master/modules/standard) are always included.

Graceful reloads

Caddy does not require a full restart when configuration is changed. Caddy comes with a caddy reload command which can be used to reload its configuration with zero downtime.

When running Caddy in Docker, the recommended way to trigger a config reload is by executing the caddy reload command in the running container.

First, you'll need to determine your container ID or name. Then, pass the container ID to docker exec. The working directory is set to /etc/caddy so Caddy can find your Caddyfile without additional arguments.

console
$ caddy_container_id=$(docker ps | grep caddy | awk '{print $1;}')
$ docker exec -w /etc/caddy $caddy_container_id caddy reload

Linux capabilities

Caddy ships with HTTP/3 support enabled by default. To improve the performance of this UDP based protocol, the underlying quic-go library tries to increase the buffer sizes for its socket. The NET_ADMIN capability allows it to override the low default limits of the operating system without having to change kernel parameters via sysctl.

Giving the container this capability is optional and has potential, though unlikely, to have security implications.

See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for more details.

Docker Compose example

If you prefer to use docker compose to run your stack, here's a sample service definition which goes in a file named compose.yaml. The configuration assumes you put a custom Caddyfile into $PWD/conf as described above.

yaml
services:
  caddy:
    image: caddy:<version>
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - $PWD/conf:/etc/caddy
      - $PWD/site:/srv
      - caddy_data:/data
      - caddy_config:/config

volumes:
  caddy_data:
  caddy_config:

Graceful reloads can then be conducted via docker compose exec -w /etc/caddy caddy caddy reload.

Image Variants

The caddy images come in many flavors, each designed for a specific use case.

caddy:<version>

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.

caddy:<version>-alpine

This image is based on the popular Alpine Linux project, available in https://hub.docker.com/_/alpine. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.

This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use musl libc instead of glibc and friends, so software will often run into issues depending on the depth of their libc requirements/assumptions. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.

To minimize image size, it's uncommon for additional related tools (such as git or bash) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the https://hub.docker.com/_/alpine/ for examples of how to install packages if you are unfamiliar).

caddy:<version>-windowsservercore

This image is based on https://hub.docker.com/r/microsoft/windows-servercore. As such, it only works in places which that image does, such as Windows 10 Professional/Enterprise (Anniversary Edition) or Windows Server 2016.

For information about how to get Docker running on Windows, please see the relevant "Quick Start" guide provided by Microsoft:

  • Windows Containers Quick Start

License

View https://github.com/caddyserver/caddy/blob/master/LICENSE for the software contained in this image.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

Some additional license information which was able to be auto-detected might be found in https://github.com/docker-library/repo-info/tree/master/repos/caddy.

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

Deployment & Usage Documentation

Caddy Docker 容器化部署指南

Caddy是一款功能强大的企业级开源Web服务器,以其内置的自动HTTPS功能和简洁的配置语法而闻名。作为用Go语言编写的现代Web服务器,Caddy提供了比传统服务器更简单的配置方式和更丰富的原生功能,包括自动TLS证书管理、HTTP/2和HTTP/3支持、反向代理、负载均衡等特性。

Read More

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 caddy 镜像标签

docker pull docker.xuanyuan.run/caddy:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull caddy:<标签>

更多 caddy 镜像推荐

caddy/caddy logo

caddy/caddy

caddy
此镜像仓库仅用于CI以支持官方Caddy镜像,实际使用请访问:https://hub.docker.com/_/caddy
47 次收藏1000万+ 次下载
1 个月前更新
caddy/ingress logo

caddy/ingress

caddy
Kubernetes ingress controller
2 次收藏5万+ 次下载
2 年前更新
reverie89/caddy logo

reverie89/caddy

reverie89
基于官方Caddy v2镜像,集成Cloudflare DNS模块,支持通过Cloudflare API自动配置SSL证书,适用于反向代理和静态网站托管的Docker镜像。
3 次收藏10万+ 次下载
7 天前更新
webhippie/caddy logo

webhippie/caddy

webhippie
基于Alpine Linux的Caddy Web服务器Docker镜像,支持通过环境变量配置,提供简单高效的Web服务部署。
4 次收藏10万+ 次下载
24 天前更新
kubesphere/caddy logo

kubesphere/caddy

kubesphere
caddy docker image
1万+ 次下载
7 年前更新
winamd64/caddy logo

winamd64/caddy

winamd64
Caddy 2 是一款强大的企业级开源Web服务器,采用Go语言编写,具备自动HTTPS功能。
1 次收藏10万+ 次下载
12 天前更新

查看更多 caddy 相关镜像

轩辕镜像配置手册

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

Docker 配置

登录仓库拉取

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

专属域名拉取

无需登录使用专属域名

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

Harbor 镜像源配置

Harbor Proxy Repository 对接专属域名

Portainer 镜像源配置

Portainer Registries 加速拉取

Nexus 镜像源配置

Nexus3 Docker Proxy 内网缓存

系统配置

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

MacOS OrbStack

MacOS OrbStack 容器配置

Docker Compose

Docker Compose 项目配置

NAS 设备

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

极空间

极空间 NAS 系统配置服务

网络设备

爱快路由

爱快 iKuai 路由系统配置

宝塔面板

在宝塔面板一键配置镜像

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

镜像拉取常见问题

使用与功能问题

配置了专属域名后,docker search 为什么会报错?

docker search 限制

Docker Hub 上有的镜像,为什么在轩辕镜像网站搜不到?

站内搜不到镜像

机器不能直连外网时,怎么用 docker save / load 迁镜像?

离线 save/load

docker pull 拉插件报错(plugin v1+json)怎么办?

插件要用 plugin install

WSL 里 Docker 拉镜像特别慢,怎么排查和优化?

WSL 拉取慢

轩辕镜像安全吗?如何用 digest 校验镜像没被篡改?

安全与 digest

第一次用轩辕镜像拉 Docker 镜像,要怎么登录和配置?

新手拉取配置

轩辕镜像合规吗?轩辕镜像的合规是怎么做的?

镜像合规机制

错误码与失败问题

docker pull 提示 manifest unknown 怎么办?

manifest unknown

docker pull 提示 no matching manifest 怎么办?

no matching manifest(架构)

镜像已拉取完成,却提示 invalid tar header 或 failed to register layer 怎么办?

invalid tar header(解压)

Docker pull 时 HTTPS / TLS 证书验证失败怎么办?

TLS 证书失败

Docker pull 时 DNS 解析超时或连不上仓库怎么办?

DNS 超时

docker 无法连接轩辕镜像域名怎么办?

域名连通性排查

Docker 拉取出现 410 Gone 怎么办?

410 Gone 排查

出现 402 或「流量用尽」提示怎么办?

402 与流量用尽

Docker 拉取提示 UNAUTHORIZED(401)怎么办?

401 认证失败

遇到 429 Too Many Requests(请求太频繁)怎么办?

429 限流

docker login 提示 Cannot autolaunch D-Bus,还算登录成功吗?

D-Bus 凭证提示

为什么会出现「单层超过 20GB」或 413,无法加速拉取?

413 与超大单层

账号 / 计费 / 权限

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

免费版与专业版区别

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

支持的镜像仓库

镜像拉取失败还会不会扣流量?

失败是否计费

麒麟 V10 / 统信 UOS 提示 KYSEC 权限不够怎么办?

KYSEC 拦截脚本

如何在轩辕镜像申请开具发票?

申请开票

怎么修改轩辕镜像的网站登录和仓库登录密码?

修改登录密码

如何注销轩辕镜像账户?要注意什么?

注销账户

配置与原理类

写了 registry-mirrors,为什么还是走官方或仍然报错?

mirrors 不生效

怎么用 docker tag 去掉镜像名里的轩辕域名前缀?

去掉域名前缀

如何拉取指定 CPU 架构的镜像(如 ARM64、AMD64)?

指定架构拉取

用轩辕镜像拉镜像时快时慢,常见原因有哪些?

拉取速度原因

查看全部问题→

用户好评

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

用户头像

oldzhang

运维工程师

Linux服务器

5

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

轩辕镜像
Docker 官方镜像
...
library/caddy
博客Docker 镜像公告与技术博客
热门查看热门 Docker 镜像推荐
安装一键安装 Docker 并配置镜像源
镜像拉取问题咨询请 提交工单,官方技术交流群:1072982923。轩辕镜像所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
镜像拉取问题咨询请提交工单,官方技术交流群:。轩辕镜像所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
商务合作:点击复制邮箱
©2024-2026 源码跳动
商务合作:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.