Home >System Tutorial >LINUX >The easiest way to understand the docker index service is here
Introduction | index As the name suggests "index", the index service mainly provides mirror indexing and user authentication functions. When downloading an image, as shown in the figure below, it will first go to the index service for authentication, then find the address of the registry where the image is located and return it to the docker client. Finally, the docker client will download the image from the registry. Of course, during the download During the process, the registry will go to the index to verify the legitimacy of the client token. Different images can be stored on different registry services, and their index information is placed on the index service. |
The implementation of docker warehouse has two operating modes
(1) standalone=true: In this mode, the warehouse itself provides a simple index service. During the implementation process, index only implements a simple index function and does not implement user authentication function
(2) standalone=false: In this mode, you need to configure the index service access point and implement the index service yourself
The REST API interface provided by index is as follows:
PUT /v1/repositories/(namespace)/(repo_name)/
It will be called in the docker push process, and its function is to create a repository. The user password and permissions will be verified before creation. If it is legal, a token will eventually be returned to the docker client
DELETE /v1/repositories/(namespace)/(repo_name)/
Delete a repository, the user password and permissions will be verified before deletion
PUT /v1/repositories/(namespace)/(repo_name)/images
It will be called in the docker push process. Its function is to update the image list corresponding to the repository. The carried token will be verified before updating.
GET /v1/repositories/(namespace)/(repo_name)/images
It will be called in the docker pull process, and its function is to obtain the image list corresponding to the repository. User password and permissions will be verified before obtaining
PUT /v1/repositories/(namespace)/(repo_name)/auth
Verify the legality of the token
GET /v1/users/
docker login will call this interface to verify the legitimacy of the user
POST /v1/users/
docker login will call this interface and can be used to create a user
PUT /v1/users/username/
Used to update user information
For the specific Header, Action, and Response requested by each interface, please refer to here (https://docs.docker.com/reference/api/docker-io_api/)
The above is the detailed content of The easiest way to understand the docker index service is here. For more information, please follow other related articles on the PHP Chinese website!