首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未能从docker buid中的cdn-fastly.deb.debian.org获取包

未能从docker buid中的cdn-fastly.deb.debian.org获取包
EN

Stack Overflow用户
提问于 2019-07-13 07:28:49
回答 2查看 3.4K关注 0票数 0

Dockerfile

代码语言:javascript
复制
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:中止安装。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-07-13 12:41:47

从源列表中,我猜这与访问deb.debian.org的不同站点有关。

代码语言:javascript
复制
$ 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的镜子,您可以选择一个在您的国家。

票数 1
EN

Stack Overflow用户

发布于 2019-07-16 09:15:06

我使用了@atline中的debian镜回答,它对我起了作用。

只是想增加一个例子。对于印度,我在Dockerfile中添加了下面的步骤

代码语言:javascript
复制
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.list
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57017075

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档