docker 切换镜像源

Dockerfile build 报错了:

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:

这个问题是默认的 Alpine Linux 的软件包镜像源无法直接访问,有些包无法下载导致的,可以更换为国内的镜像源

新版的 docker 的配置文件 /etc/docker/daemon.json 中可以更改镜像源:

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

Docker 官方中国区

https://registry.docker-cn.com

网易

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

ustc

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

猜你喜欢

转载自blog.csdn.net/SHELLCODE_8BIT/article/details/134718112
今日推荐