我使用以下命令构建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.
为什么会这样?如何修复?