注意:由于技术限制,镜像模式下仍需要手动指定 library 前缀,建议使用直接拉取方式。
编辑 Docker 守护程序配置文件(通常在 /etc/docker/daemon.json):
{
"registry-mirrors": ["https://gp.hoshicc.cc"]
}
然后重启 Docker 服务:
sudo systemctl daemon-reload
sudo systemctl restart docker
配置后仍需使用完整路径:
# 即使配置了镜像,仍需要指定 library 前缀
docker pull library/nginx:latest
你可以通过在镜像名称前加上 worker 地址来拉取镜像。
重要:Docker Hub 官方镜像需要显式添加 /library/ 前缀。
# Docker Hub 官方镜像(必须包含 /library/ 前缀)
docker pull gp.hoshicc.cc/library/nginx:latest
docker pull gp.hoshicc.cc/library/alpine:3.18
docker pull gp.hoshicc.cc/library/ubuntu:22.04
docker pull gp.hoshicc.cc/library/hello-world
# Docker Hub 组织/用户镜像(不需要 library 前缀)
docker pull gp.hoshicc.cc/bitnami/redis:latest
docker pull gp.hoshicc.cc/mysql/mysql-server:latest
# GitHub Container Registry
docker pull gp.hoshicc.cc/ghcr.io/microsoft/vscode:latest
docker pull gp.hoshicc.cc/ghcr.io/linuxserver/nginx:latest
# Google Container Registry
docker pull gp.hoshicc.cc/gcr.io/distroless/static:latest
# Quay.io
docker pull gp.hoshicc.cc/quay.io/prometheus/prometheus:latest
gp.hoshicc.cc/library/镜像名 格式gp.hoshicc.cc/用户名/镜像名gp.hoshicc.cc/ghcr.io/owner/repodocker login gp.hoshicc.cc 进行身份验证这个 worker 也可以作为任何 URL 的简单开放代理:
# 代理网站
https://gp.hoshicc.cc/https://github.com
# 代理 API 端点
https://gp.hoshicc.cc/https://api.github.com/users/octocat