🐳 Docker Registry Proxy

使用说明

1. 配置为 Docker 镜像

注意:由于技术限制,镜像模式下仍需要手动指定 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

2. 直接拉取镜像

你可以通过在镜像名称前加上 worker 地址来拉取镜像。

Docker Hub 镜像

重要: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

其他 Registry

# 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
⚠️ 重要说明:

5. HTTP 代理功能

这个 worker 也可以作为任何 URL 的简单开放代理:

# 代理网站
https://gp.hoshicc.cc/https://github.com
# 代理 API 端点
https://gp.hoshicc.cc/https://api.github.com/users/octocat