index顧名思義「索引」,index服務主要提供鏡像索引以及用戶認證的功能。當下載一個鏡像的時候,首先會去index服務上 作認證,而後查找鏡像所在的registry的地址並放回給docker客戶端,最終docker客戶端再從registry下載鏡像,固然在下載過程當中 registry會去index校驗客戶端token的合法性。不一樣鏡像能夠保存在不一樣的registry服務上,其索引信息都放在index服務上。linux
開源社區docker倉庫 的實現,有兩種運行模式docker
(1)standalone=true:在這種模式下,倉庫自身提供了簡單的index服務,在實現過程當中index只是實現了簡單的索引功能,沒有實現用戶認證功能運維
(2)standalone=false:在這種模式下,須要配置index的服務訪問點,需自行實現index服務linux運維
index服務對外提供的接口spa
index對外提供的REST API接口以下:.net
PUT /v1/repositories/(namespace)/(repo_name)/視頻
在docker push的流程中會調用到,其做用是建立一個repository。建立以前會對用戶密碼以及權限進行驗證,若是合法,則最終會返回一個token至docker客戶端教程
DELETE /v1/repositories/(namespace)/(repo_name)/索引
刪除一個repository,刪除以前會對用戶密碼以及權限進行驗token
PUT /v1/repositories/(namespace)/(repo_name)/images
在docker push流程中會調用到,其做用是更新repository對應的image列表,更新以前會校驗攜帶的token
GET /v1/repositories/(namespace)/(repo_name)/images
在docker pull流程中會調用到,其做用是獲取repository對應的image列表。獲取以前會對用戶密碼以及權限進行驗證
PUT /v1/repositories/(namespace)/(repo_name)/auth
校驗token的合法性
GET /v1/users/
docker login會調用到此接口,用來驗證用戶的合法性
POST /v1/users/
docker login會調用到此接口,可用來建立一個用戶
PUT /v1/users/username/
用來更新用戶信息
免費領取兄弟連IT教育原創linux運維工程師視頻/細說linux教程,詳情諮詢官網客服:http://www.lampbrother.net/linux/
或者勾搭Q2430675018
歡迎加入linux交流羣 478068715