docker 异常: failed to fetch oauth token: Post “https://auth.docker.io/token“: dial tcp 148.163.48.
【代码】docker 异常: failed to fetch oauth token: Post “https://auth.docker.io/token“: dial tcp 148.163.48.
·
docker 异常: failed to fetch oauth token: Post “https://auth.docker.io/token”: dial tcp 148.163.48.215:443: i/o timeout
报错信息
ERROR: failed to solve: python:3.9-slim: failed to resolve source metadata for docker.io/library/python:3.9-slim: failed to authorize: failed to fetch oauth token: Post "https://auth.docker.io/token": dial tcp 148.163.48.215:443: i/o timeout
原因
网络问题:
由于一些众所周知的原因,在墙内是上不了外网的,然后前段时间还把国内docker的镜像站都给关了。
所以你需要配置代理,但是,可能会存在你已经打开了全局代理,还是没法下载镜像。
解决
我的是macos,所以直接在 bash 中添加环境变量,操作如下:
vim ~/.bash_profile
# 添加以下内容
export https_proxy=http://127.0.0.1:7890
export http_proxy=http://127.0.0.1:7890
source ~/.bash_profile
docker build --platform linux/amd64 -t fastapi-hello .
# 成功
更多推荐
所有评论(0)