[docker] Run registry

Introduction to registry

Docker registry is a service of docker image warehouse, used to store and distribute docker images.

Main features and functions of Docker registry:

Storage of docker images: Provides the function of persistently storing docker images and storing each layer of the image.

Distribution image: a decentralized storage and distribution service for pulling and pushing images.

Support version management: label images to manage different versions of images.

Support access rights: restrict image access and push through user login authentication.

Provide HTTP/HTTPS API: API to implement image-related operations, such as searching, pushing, deleting images, etc.

Diversified storage backend: supports different backend storage images such as file system and Amazon S3 object storage.

Download accelerated distribution: Global download acceleration is achieved through CDN technology.

The most common registries are Docker Hub and private registry. Docker Hub is an open source registration center, and private registry is mainly used for internal image management.

The docker command calls the registry directly or through HTTP API to complete the life cycle management of the image. It is an important component to achieve persistence and distribution of docker images.

Run registry

1. Pull the registry image

docker pull registry:2

2. Run the registry container

docker run -d -p 5000:5000 --restart=always --name my-registry registry:2

3. Check status

docker ps
Insert image description here

4. Push the image to the registry

docker tag registry:2 localhost:5000/my-registry:1.0
docker push localhost:5000/my-registry:1.0

Visit registry

View image list

Excuting an ordercurl http://localhost:5000/v2/_catalogInsert image description here

or
visithttp://localhost:5000/v2/_catalogInsert image description here

View all tags for a specified image

http://localhost:5000/v2/my-registry/tags/list
Insert image description here

Other interfaces

The registry container run by docker mainly provides the following HTTP/HTTPS interfaces:

/v2/: Image management interface
includes operations such as viewing, searching, taking pictures, pushing, and deleting images.

/v2/_catalog: View all repositories in the mirror library

/v2//tags/list: View all tags under the specified repository

/v2//manifests/: Get manifest information

/v2//blobs/: Get information about a layer

/v2//blobs/uploads/: Upload new layer

/v2//blobs/: download layer

/healthz: View registry running status

/version: View registry version information

/favicon.ico: Get the favicon icon

Guess you like

Origin blog.csdn.net/u011308433/article/details/132499523