犀牛云建设网站,网站怎么做代码优化,广点通投放平台登录,网站推广外链怎么做最近上交、科大以及阿里的一些docker镜像#xff0c;好像都因为不可控力导致无法访问。 所以#xff0c;之前好多正常的一些镜像的打包都会报错#xff1a; 比如#xff1a;
#1 [internall load build definition from Dockerfile#1transferring dockerfile:972B done#1 D…最近上交、科大以及阿里的一些docker镜像好像都因为不可控力导致无法访问。 所以之前好多正常的一些镜像的打包都会报错 比如
#1 [internall load build definition from Dockerfile#1transferring dockerfile:972B done#1 DONE O.1S
#2[internall load .dockerignore transferring context:112B done#2 DONE O.1S
#3 「internal] load metadata for docker.io/library/python:3.9#3 ERROR: failed to copy: httpReadseeker: failed open: failed to dorequest:
[internal] load metadata for docker.io/library/python:3.9:
Dockerfile:1
FROM python:3.92 RUN apt-get update
RUN apt-get upgrade -y-.....
Exceeded: python:3.9: failed to copy: http Readseeker: failed open: faiERROR: failed to solve: DeadlineExceeded: DeadlineExceeded: DeadlinLed to do request: Get https://production.cloudflare.docker.com/ 原先跑的好好的程序突然遇到这种报错基本上就是遭灾了。 遇到这种情况需要有2个复杂的代理设置。更加不幸的是我被Claude耽误了3个小时 后面在群友的帮助下以及官网文档的指导下我给大家总结好了靠谱的教程假设你的电脑本身就可以正常上网具体的不要在评论区和私信讨论默认大家都会~ 不知道这个帖子能不能发出去希望能对大家有帮助。
1. 设置/etc/docker/daemon.json
这个直接用vim打开或者vscode打开都行我以vim为例子
sudo vim /etc/docker/daemon.json 然后在原来的daemon.json文档中添加对应的代理地址最终的效果如下
{proxies: { http-proxy: http://127.0.0.1:7890,https-proxy: http://127.0.0.1:7890,no-proxy: localhost,127.0.0.0/8}
}注意这里需要确保冒号逗号符合字典的格式稍微有一点格式错误都无法重启docker。 另外这个no-proxy可以不加。
2. 设置~/.docker/config.json 文件
先用vim编辑config
sudo vim /etc/docker/daemon.json
然后填入
{auths: {registry.cn-hongkong.aliyuncs.com: {auth: xxxxxx}},proxies: {default: {httpProxy: http://127.0.0.1:7890,httpsProxy: http://127.0.0.1:7890,noProxy: 127.0.0.0/8}}
} 然后把对应的json文件改成上面的格式就好了一般来说都会有一个默认的阿里云的账户没有也没关系删掉对应的内容即可。
2.重新启动 Docker daemon
sudo systemctl restart docker 如果报错
Job for docker.service failed because the control process exited with error code See systemctl status docker.servicelyl lyl:~$and journalctl -xe for details.基本上就是你的daomon.json没配置好。 4. 检查结果 如果能正常build image基本上就OK了。
这里build的参考命令如下
docker build --networkhost -t image_name:lastest . 注意这里的network需要设置为host
如果帖子能发出去感谢大家的三联支持~