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

Detailed explanation of keywords and reserved words in MySQL 5.7

Preface The keywords of MySQL and Oracle are not ...

How to install JDK and Mysql on Ubuntu 18.04 Linux system

Platform deployment 1. Install JDK step1. Downloa...

Using front-end HTML+CSS+JS to develop a simple TODOLIST function (notepad)

Table of contents 1. Brief Introduction 2. Run sc...

Alibaba Cloud Server Tomcat cannot be accessed

Table of contents 1. Introduction 2. Solution 2.1...

How to solve the problem that MySQL cannot start because it cannot create PID

Problem Description The MySQL startup error messa...

CSS World--Code Practice: Image Alt Information Presentation

Using the <img> element with the default sr...

Basic learning and experience sharing of MySQL transactions

A transaction is a logical group of operations. E...

Detailed installation and use of SSH in Ubuntu environment

SSH stands for Secure Shell, which is a secure tr...

How to draw a mind map in a mini program

Table of contents What is a mind map? How to draw...

CSS realizes process navigation effect (three methods)

CSS realizes the process navigation effect. The s...

Example of using JS to determine whether an element is an array

Here are the types of data that can be verified l...