Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
生成Docker映像在一台计算机上成功,但在另一台计算机上失败,原因是“无法解析…”`_Docker_Build_Dns_Docker Image - Fatal编程技术网

生成Docker映像在一台计算机上成功,但在另一台计算机上失败,原因是“无法解析…”`

生成Docker映像在一台计算机上成功,但在另一台计算机上失败,原因是“无法解析…”`,docker,build,dns,docker-image,Docker,Build,Dns,Docker Image,我使用以下命令构建Docker映像: docker build -t my-tag:0.0.0 -f Dockerfile-staging . 在我的机器上(泰国的MBP),它可以工作。 在我的同事的机器(Ubuntu,中国)上,它出现以下错误: Step 3/9 : RUN apt-get update && apt-get upgrade -y && apt-get install -y gcc && apt-get

我使用以下命令构建Docker映像:

docker build -t my-tag:0.0.0 -f Dockerfile-staging .
在我的机器上(泰国的MBP),它可以工作。 在我的同事的机器(Ubuntu,中国)上,它出现以下错误:

Step 3/9 : RUN apt-get update &&     apt-get upgrade -y &&     apt-get install -y gcc &&     apt-get install -y git &&     apt-get install -y libcurl4 &&     apt-get install -y libpq-dev &&     apt-get install -y libssl-dev &&     apt-get install -y python3-dev &&     apt-get install -y librtmp-dev &&     apt-get install -y libcurl4-gnutls-dev &&     apt-get install -y libcurl4-openssl-dev &&     apt-get install -y postgresql-9.3 &&     apt-get install -y python-psycopg2
 ---> Running in f405a317507e
Err:1 http://deb.debian.org/debian buster InRelease
  Could not resolve 'debian.map.fastlydns.net' Could not resolve 'deb.debian.org'
Err:2 http://security.debian.org/debian-security buster/updates InRelease
  Could not resolve 'debian.map.fastlydns.net' Could not resolve 'security.debian.org'
Err:3 http://deb.debian.org/debian buster-updates InRelease
  Could not resolve 'debian.map.fastlydns.net' Could not resolve 'deb.debian.org'
Reading package lists...
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Could not resolve 'debian.map.fastlydns.net' Could not resolve 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Could not resolve 'debian.map.fastlydns.net' Could not resolve 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Could not resolve 'debian.map.fastlydns.net' Could not resolve 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

为什么会这样?如何修复?

另一台机器上的DNS查找失败。对Debian网站执行
nslookup
,如
nslookup security.Debian.org
,将有助于隔离问题。此外,您可以在其工作的机器上尝试
——无缓存
——它可能使用以前版本的本地缓存