配置阿里雲鏡像加速器
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors

mkdir -p /etc/docker tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://djkge06j.mirror.aliyuncs.com"] } EOF systemctl daemon-reload systemctl restart docker
PUSH鏡像原理 用戶發送請求到index來下載鏡像。 index 響應返回三個相關部分信息: 該鏡像位於的registry該鏡像包括所有層的校驗以授權目的Token 用戶通過響應中返回的Token和registry溝通,registry全權負責鏡像,它存儲基本的鏡像和繼承的層。 registry現在要與index證實該token是被授權的。 index會發送“true” 或者 “false”給registry,由此允許用戶下載所需要的鏡像。 PULL鏡像 具體工作流程如下: 用戶發送帶證書請求到index要求分配庫名。 在成功認證,命名空間可用以及庫名被分配之后。index響應返回臨時的token。 鏡像連帶token,一起被推送到registry中。 registry與index證實token,然后在index驗證之后開始讀取推送流。 該index然后更新由Docker生成的鏡像校驗。 刪除鏡像: index接收來自Docker一個刪除庫的信號。 如果index驗證庫成功,它將刪除該庫,並返回一個臨時token。 registry現在接收到帶有該token的刪除信號。 registry與index核實該token,然后刪除庫以及所有相關信息。 Docker現在通知有關刪除的index,然后index移除庫的所有記錄 docker registry有三個角色:index registry registry client index:負責並維護有關用戶賬戶,鏡像校驗以及公共命名空間信息 registry:是鏡像與圖表的倉庫,不具有本地數據以及不提供用戶認證,主要通過INDEX中的Auth Serveice的Token方法進行驗證。 Registry Client:docker充當registry客戶端來維護拉取與推送,以及客戶端授權。
相關鏡像加速站點:
"https://djkge06j.mirror.aliyuncs.com","https://registry.docker-cn.com","https://docker.mirrors.ustc.edu.cn","https://dockerhub.azk8s.cn","http://hub-mirrors.c.163.com"
https://djkge06j.mirror.aliyuncs.com -------- 阿里雲鏡像站點
https://registry.docker-cn.com -------- docker中國官網鏡像站點
https://docker.mirrors.ustc.edu.cn 科大鏡像站點
https://dockerhub.azk8s.cn ---------- azure docker鏡像加速站點,由micorsorft微軟加速站點
http://hub-mirrors.c.163.com ------------- 163docker鏡像站點
