Solve the problem of docker pull image error

Solve the problem of docker pull image error

describe:

Install VM under Windows 10, run Docker in VM, and get an error when using Docker pull to pull the image

one,

Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

reason:

When using the docker pull command to pull an image, if no additional information is added, such as docker pull nginx, the default image pull address will be a foreign warehouse, causing DNS resolution timeout.

Solution:

1.) Change the default DNS of VM to 8.8.8.8

2.) Use the domestic image warehouse to pull the image

two,

Trying to pull repository docker.io/library/nginx ... Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout

reason:

The http handshake failed because of the use of a foreign address.

Solution:

1.) Manually specify the domestic warehouse address every time you pull the image docker pull registry.docker-cn.com/library/nginx

2.) Modify the /etc/docker/daemon.json file (change the default warehouse address to the domestic address to save manual entry every time)

vim /etc/docker/daemon.json -> write
{ "registry-mirrors": ["https://registry.docker-cn.com"] }

Finally, restart docker systemctl daemon-reload + systemctl restart docker

3. I want to complain that CSDN's markdown is really difficult to use and does not support many grammars.

Supplement: Solution to docker pull image error or timeout, change the pull address to domestic image warehouse

The default image pull address of Docker is a foreign warehouse, which has a slow download speed and may even report the following error

Error response from daemon: Get https://docker.elastic.co/v2/: net/http: TLS handshake timeout

Solution modification

/etc/docker/daemon.json file and add the registry-mirrors key value. Then restart Docker.
 "registry-mirrors": ["https://registry.docker-cn.com"]
}

Supplement: Solve the problem of docker failing to download images in CentOS7

question

Yesterday I bought a student machine of Alibaba Cloud Server for six months to deploy the graduation project environment. When I was tinkering with Docker, a problem occurred. Docker was successfully installed and started successfully, as shown in the figure

But when I pulled the image, I encountered a timeout and could not download the image. I guess the domestic docker official image was blocked. I searched online for a long time and found that I needed to use domestic image acceleration. Daocloud and Alibaba Cloud are recommended. I used Daocloud image acceleration. After registering an account, there will be a hyperlink to image acceleration above.

After clicking in, there are various system scripts for adding domestic mirror acceleration

After running the script, execute the pull operation again, and the image is successfully downloaded

At this time, execute docker images to see the downloaded image

Make a record so you don't forget it after a long time.

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me.

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
  • Docker configuration Alibaba Cloud image acceleration pull implementation
  • 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

<<:  Basic tutorial on using explain statement in MySQL

>>:  How to use default values ​​for variables in SASS

Recommend

JavaScript+html implements random QR code verification on front-end pages

Share the cool front-end page random QR code veri...

Detailed explanation of MySQL's MERGE storage engine

The MERGE storage engine treats a group of MyISAM...

A solution to a bug in IE6 with jquery-multiselect

When using jquery-multiselect (a control that tra...

NodeJS realizes image text segmentation

This article shares the specific code of NodeJS t...

Oracle deployment tutorial in Linux environment

1. Environment and related software Virtual Machi...

Vue3 manual encapsulation pop-up box component message method

This article shares the specific code of Vue3 man...

JS, CSS style reference writing

CSS: 1. <link type="text/css" href=&q...

CSS uses radial-gradient to implement coupon styles

This article will introduce how to use radial-gra...

Examples of common Nginx misconfigurations

Table of contents Missing root location Off-By-Sl...

Tutorial on resetting the root password of Mac MySQL

Disclaimer: This password reset method can direct...

React entry-level detailed notes

Table of contents 1. Basic understanding of React...

How to fix the WeChat applet input jitter problem

Find the problem Let's look at the problem fi...

Vue.js front-end web page pop-up asynchronous behavior example analysis

Table of contents 1. Preface 2. Find two pop-up c...