Docker configuration Alibaba Cloud image acceleration pull implementation

Docker configuration Alibaba Cloud image acceleration pull implementation

Today I used docker to pull the image, but the speed was so bad that I couldn't see it, and I kept waiting until the end.

read tcp 192.168.31.60:55550->104.18.123.25:443: read: connection reset by peer

Transmission anomaly

Then I saw on the Internet that I could configure the image acceleration provided by Alibaba Cloud

Specific method

Enter Alibaba Cloud's Container Image Service

Quick Links: Container Registry

Copy the accelerator address

Find the daemon.json file in the /etc/docker directory (create it if it doesn’t exist) and write the following content into it

  {
   "registry-mirrors": ["https://xxxxxx.mirror.aliyuncs.com"]
  }

The address is the address you copied on the Alibaba Cloud website in step 2

Restart daemon

systemctl daemon-reload

Restart the Docker service

systemctl restart docker

Done, tested it, the pull is fast and comfortable. . . .

Additional knowledge: Docker pull/push images from Alibaba Cloud

Log in to Alibaba Cloud Docker registry:

$ sudo docker login [email protected] registry.cn-hangzhou.aliyuncs.com

The username for logging into the registry is the full name of your Alibaba Cloud account, and the password is the password you set when activating the service.

You can change the docker login password by clicking the button in the upper right corner on the image management homepage.

Pull the image from the registry:

$ sudo docker pull registry.cn-hangzhou.aliyuncs.com/qz/nginx-vim:[image version number]

Push the image to the registry:

$ sudo docker login [email protected] registry.cn-hangzhou.aliyuncs.com

$ sudo docker tag [ImageId] registry.cn-hangzhou.aliyuncs.com/qz/nginx-vim:[image version number]

$ sudo docker push registry.cn-hangzhou.aliyuncs.com/qz/nginx-vim:[image version number]

Please fill in [ImageId] and [Image version number] according to your own image information.

Pay attention to your network environment

When pushing images from ECS, you can choose to use the intranet, which will greatly increase the speed and will not consume your public network traffic.

If the machine you applied for is in the classic network, please use registry-internal.cn-hangzhou.aliyuncs.com as the domain name of the registry to log in and as the image namespace prefix

If the machine you applied for is in a vpc network, please use registry-vpc.cn-hangzhou.aliyuncs.com as the domain name of the registry to log in and as the image namespace prefix

sample:

Rename the image using docker tag and push it to the registry via the private network ip:

$ sudo docker images

REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
registry.aliyuncs.com/acs/agent 0.7-dfb6816 37bb9c63c8b2 7 days ago 37.89 MB

$ sudo docker tag 37bb9c63c8b2 registry..aliyuncs.com/acs/agent:0.7-dfb6816

Find your imageId through docker images and rename the image domain to the registry intranet address for the changed imageId.

$ sudo docker push registry..aliyuncs.com/acs/agent

The above article about configuring Alibaba Cloud image acceleration pull in Docker is all I have to share with you. I hope it can be a reference for you. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of where the image pulled by docker is stored
  • Docker pull image and tag operation pull | tag
  • Detailed explanation of where the images pulled by docker are stored
  • Solution to the problem of slow docker pull image speed
  • How to solve the problem of slow docker pull image speed
  • Detailed explanation of where the image files pulled by docker are stored
  • Solve the problem of docker pull image error

<<:  Detailed explanation of how to prevent content from being selected, copied, or right-clicked in HTML pages

>>:  Detailed explanation of communication between hierarchical nested components in Vue front-end development

Recommend

About MySQL 8.0.13 zip package installation method

MySQL 8.0.13 has a data folder by default. This f...

HTML set as homepage and add to favorites_Powernode Java Academy

How to implement the "Set as homepage" ...

Ant Design Blazor component library's routing reuse multi-tab function

Recently, there has been a growing demand for imp...

6 inheritance methods of JS advanced ES6

Table of contents 1. Prototype chain inheritance ...

Pure HTML+CSS to achieve typing effect

This article mainly introduces the typing effect ...

MySQL integrity constraints definition and example tutorial

Table of contents Integrity constraints Definitio...

The latest collection of 18 green style web design works

Toy Story 3 Online Marketing Website Zen Mobile I...

Summary of 28 common JavaScript string methods and usage tips

Table of contents Preface 1. Get the length of a ...

Two methods to stretch the background image of a web page

There are two solutions: One is CSS, using backgro...

Node.js+express message board function implementation example

Table of contents Message Board Required librarie...

How to automatically back up the mysql database regularly

We all know that data is priceless. If we don’t b...

Detailed explanation of the use of Join in Mysql

In the previous chapters, we have learned how to ...

CSS optimization skills self-practice experience

1. Use css sprites. The advantage is that the smal...