Dockerfile
FROM debian:stretch
RUN apt-get update && apt-get install -yq --no-install-recommends --force-yes --fix-missing\
curl \
git \
openjdk-8-jdk \
maven \
python2.7 python2.7-setuptools \
python3 python3-setuptools \
r-base \
r-base-core && \
rm -rf /var/lib/apt/lists/*在构建这个Dokerfile时,我发现了错误:
W:--武力--是的--被否决了,使用其中一个选项--以--允许代替。E:未能获取amd64.deb连接失败E:未能获取amd64.deb连接失败E:未能获取amd64.deb连接失败E:未能获取all.deb连接失败E:中止安装。
发布于 2019-07-13 12:41:47
从源列表中,我猜这与访问deb.debian.org的不同站点有关。
$ docker run --rm -it debian:stretch cat /etc/apt/sources.list
# deb http://snapshot.debian.org/archive/debian/20190708T033000Z stretch main
deb http://deb.debian.org/debian stretch main
# deb http://snapshot.debian.org/archive/debian-security/20190708T033000Z stretch/updates main
deb http://security.debian.org/debian-security stretch/updates main
# deb http://snapshot.debian.org/archive/debian/20190708T033000Z stretch-updates main
deb http://deb.debian.org/debian stretch-updates main将您的步骤移动到http://deb.debian.org/,您可以看到以下内容:
服务器deb.debian.org本身没有包,但是名称在DNS中有SRV记录,这些记录允许apt扩展,然后才能找到位置。
所以我想,有时它会把你转到一个镜子上,因为你的本地网络限制,这对你来说可能不太适合。因此,我建议您直接使用一个合适的sources.list来取代原来的图像,所有可用的所有Debian的镜子,您可以选择一个在您的国家。
发布于 2019-07-16 09:15:06
我使用了@atline中的debian镜回答,它对我起了作用。
只是想增加一个例子。对于印度,我在Dockerfile中添加了下面的步骤
RUN echo \
'deb http://mirror.cse.iitk.ac.in/debian/ stretch main\n \
deb http://security.debian.org/debian-security stretch/updates main\n \
deb http://mirror.cse.iitk.ac.in/debian/ stretch-updates main\n' \
> /etc/apt/sources.listhttps://stackoverflow.com/questions/57017075
复制相似问题