docker switch image source

Dockerfile build reported an error:

WARNING: fetching https://dl-cdn.alpinelinux.org/alpine/v3.18/main: temporary error (try again later)
WARNING: fetching https://dl-cdn.alpinelinux.org/alpine/v3.18/community:

This problem is caused by the fact that the default Alpine Linux software package mirror source cannot be directly accessed, and some packages cannot be downloaded. It can be replaced with a domestic mirror source.

The image source can be changed in the configuration file /etc/docker/daemon.json of the new version of docker:

 {
     "registry-mirrors": ["https://registry.docker-cn.com"]
   }

Docker official China area

https://registry.docker-cn.com

NetEase

http://hub-mirror.c.163.com

above

https://docker.mirrors.ustc.edu.cn

Guess you like

Origin blog.csdn.net/SHELLCODE_8BIT/article/details/134718112