![使用 docker 获取 http://deb.debian.org/debian/dists/jessie-updates/InRelease 时出现问题](https://linux22.com/image/1587810/%E4%BD%BF%E7%94%A8%20docker%20%E8%8E%B7%E5%8F%96%20http%3A%2F%2Fdeb.debian.org%2Fdebian%2Fdists%2Fjessie-updates%2FInRelease%20%E6%97%B6%E5%87%BA%E7%8E%B0%E9%97%AE%E9%A2%98.png)
我正在尝试运行命令 docker-compose build
我得到这个输出:
Step 4/8 : RUN apt-get update && apt-get install -y google-chrome-stable
---> Running in ee9551cd38b9
Ign http://dl.google.com stable InRelease
Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
.....
Get:9 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
W: Fetched 10.1 MB in 6s (1519 kB/s)
Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)
E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR: Service 'webpack' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y google-chrome-stable' returned a non-zero code: 100
谁有想法?
答案1
我今天早上也遇到了这个问题。我通过结合以下两张票的建议解决了这个问题:
如何解决 AWS apg-get for debian jessie fetch 中的 404 错误?
解决方案:
在您的中Dockerfile
,在运行任何apt
命令之前,添加以下行:
RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
这使得可以apt
从新源运行。
Docker 镜像可能debian:jesse
会在不久的将来更新以正常工作,但在此之前,这将允许您继续工作
答案2
Debian 团队已经修复了这个问题. 再次拉取图像以便更新,为我修复了此问题:
docker pull debian:jessie
来自链接票的警告:
另外,请尽快迁移 Jessie——时间紧迫!!
答案3
我的解决方案
快速解决方法
覆盖sources.list
不是我想要的:
sed '/jessie-updates/s/^/# /' -i /etc/apt/sources.list
只会注释掉包含的行jessie-updates
,其他的都保留!
deb http://ftp.ch.debian.org/debian/ jessie main contrib deb-src http://ftp.ch.debian.org/debian/ jessie main contrib deb http://security.debian.org/ jessie/updates main contrib deb-src http://security.debian.org/ jessie/updates main contrib # # jessie-updates, previously known as 'volatile' # deb http://ftp.ch.debian.org/debian/ jessie-updates main contrib # deb-src http://ftp.ch.debian.org/debian/ jessie-updates main contrib
因此我继续使用本地镜像Debian jessie
继续支持。
升级到拉紧
然后为了升级到拉伸,我只是
sed 's/jessie/stretch/' -i.jessie /etc/apt/sources.list
这将创建一个source.list.jessie
然后我可以取消注释stretch-updates
行:
sed '/stretch-updates/s/^# //' -i /etc/apt/sources.list