Skip to content

Commit

Permalink
fix: 更新 README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
brighill authored Jun 13, 2024
1 parent 386d9c8 commit 3fd10d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 自建Docker镜像加速&缓存服务
# 自建 Docker 镜像加速&缓存服务

> 利用Docker镜像仓库的[镜像代理与缓存](https://docs.docker.com/registry/recipes/mirror/) 功能加速镜像下载,并使用 nginx 根据域名进行分流,客户端通过自建仓库拉取镜像并缓存在服务端,加快镜像拉取速度。
> 利用 Registry 的 [镜像代理与缓存](https://docs.docker.com/registry/recipes/mirror/) 功能加速&缓存镜像,同时支持 dockerhub、gcr.io、quay.io、nvcr.io、registry.k8s.io 等多个仓库,保持原有仓库的镜像tag不变,且一次拉取之后打包整个仓库目录可离线使用,
## 启动服务端
```sh
git clone https://github.com/brighill/registry-mirror.git
cd registry-mirror
#生成证书
# 生成证书
./gencert.sh
# 如果在无法访问gcr.io的机器上启动服务则需要增加代理
# export PROXY=ip:port
Expand All @@ -16,8 +16,8 @@ docker-compose up -d
## 配置客户端
修改/etc/hosts将域名解析劫持到自己的IP(如果有自建DNS服务也可以改DNS配置)
```sh
#vim /etc/hosts
192.168.1.1 gcr.io k8s.gcr.io quay.io docker.io registry-1.docker.io nvcr.io registry.k8s.io custom.local
# vim /etc/hosts
192.168.1.1 gcr.io quay.io docker.io registry-1.docker.io nvcr.io registry.k8s.io custom.local
```

信任证书(不同操作系统步骤可能不一样)
Expand All @@ -37,7 +37,7 @@ sudo update-ca-certificates
```

```sh
#CentOS/Fedora/RHEL
# CentOS/Fedora/RHEL
sudo yum install ca-certificates
sudo update-ca-trust force-enable
sudo cp cert/ca.crt /etc/pki/ca-trust/source/anchors/
Expand Down

0 comments on commit 3fd10d3

Please sign in to comment.