记录一次 Docker Registry Proxy 的 HTTPS 证书续期排查
记录一次 Docker Registry Proxy 的 HTTPS 证书续期排查 背景 我有一套自建的 Docker Registry Proxy 服务 可看这篇博客docker自建镜像加速 | 安落滢 Blog - 技术分享与生活记录,用来代理 Docker Hub、GHCR、Quay、GCR、K8S、MCR、NVCR 等镜像源。 服务整体跑在 Debian 服务器上,Nginx 运行在 Docker 容器中,由于没有 80、443 端口。对外统一暴露 5050 端口。 假设我的域名是 666.xyz ,访问方式大概是: 1 2 3 4 5 6 7 8 https://hubcmd.666.xyz:5050/ https://ghcr.666.xyz:5050/ https://quay.666.xyz:5050/ https://gcr.666.xyz:5050/ https://k8s.666.xyz:5050/ https://mcr.666.xyz:5050/ https://elastic.666.xyz:5050/ https://nvcr.666.xyz:5050/ 这些域名都在 Cloudflare 做 DNS 解析,并且关闭了小黄云代理,直接解析到服务器公网 IP。 这次问题的起因,是我在服务器通过mirror拉取镜像时遇到报错,报错如下。 1 ERROR: failed to solve: python:3.12-slim: failed to resolve source metadata for docker.io/library/python:3.12-slim: failed to do request: Head "https://hub.666.xyz:5050/v2/library/python/manifests/3.12-slim?ns=docker.io": tls: failed to verify certificate: x509: certificate has expired or is not yet valid: current time 2026-06-02T16:35:32+08:00 is after 2026-05-31T06:13:08Z 好家伙,证书过期,这是第一次纯手工部署的项目证书过期,之前偷懒都是用的宝塔、1panel 这些平台托管,想起来了 certbot 什么的可以用,但我还没试过,刚好试试。 ...