1.Docker Hub

A warehouse is a centralized place for storing images.

At present, Docker official warehouse maintains a public warehouse https://hub.docker.com, which already includes more than 15,000 mirrors.

Most of these requirements can be achieved by mirroring directly in the Docker Hub.

The login

You can login by running the docker login command to enter the user name, password, and email address.




Basic operation

Users can use docker search command to find the image in the official warehouse without login, and download it to the local using Docker pull, and push the local image to the Docker Hub through docker push command.

Tag a copy of the image and push the image to the server







2. Create and use private repositories

Create a private repository using the Registry image

A set of local private warehouses can be built by the registry image officially provided by Docker.

Image address: https://hub.docker.com/_/registry/

Command:

docker run -eSEARCH_BACKEND=sqlalchemy-eSQLALCHEMY_INDEX_DATABASE=sqlite:////tmp/docker-registry.db-d –name registry -p 5000:5000 registry




-e Sets environment variables

-d Indicates that the mirror is started in background mode

-name Specifies a name for the started container

-p exposes the port. 5000 inside the container is bound to port 5000 on the host.

Registry image itself

SEARCH_BACKEND= SQLalchemy The default index is queryable

Reference Address:

https://github.com/docker/docker-registry#search-engine-options

https://hub.docker.com/_/registry/

Automatically downloads and starts a Registry container to create a local private repository service.

The default repository is created in the/TMP /registry directory.




Upload it to a local private warehouse,




HTTP :server gave HTTP response to HTTPS client.

Docker startup parameter configuration:

Environment: centos7 addresses this issue

The configuration file: / lib/systemd/system/docker. Service

Modified to:

#ExecStart=/usr/bin/dockerd

ExecStart = / usr/bin/dockerd -h TCP: / / 0.0.0.0:2375 – H Unix: / / / var/run/docker. The sock, insecure – registry192.168.100.146:5000

(the default port 2375 as the main management, Unix: / / / var/run/docker. The sock for the local management, 7654 is spare port)




Restart the service, start a private repository container, and then push it to the private repository




Refer to the address: https://docs.docker.com/engine/admin/configuring/

3. Warehouse acceleration service

Speed up the download of official images.

Recommend a service: https://dashboard.daocloud.io/

Click on the accelerator: https://dashboard.daocloud.io/mirror










Docker accelerator configuration:




Download the third-party official warehouse.

4. Warehouse management

Registry Web UI

Used for mirror query, deleted.

Mirror address: https://hub.docker.com/r/atcol/docker-registry-ui/







Start command: When running the following commands, it is recommended to configure the acceleration mentioned above, because there are a lot of things to download.

Docker run – d – nameregistry_ui – p, 8080:8080 – e REG1 = http://172.17.0.2:5000/v1/atcol/docker-registry-ui




Check whether the port is enabled




Check the logs




Visit address:

http://IP address: 8080




Previous Docker lessons:

Know the docker

Core concepts and installation

Common operations for mirroring

Basic container operations