apt-get update在先前正在运行的构建中失败了404

问题描述 投票:12回答:1

我正在运行Travis构建,它在构建mysql时失败:5.7.27 docker镜像。 Dockerfile运行apt-get update然后我得到一个错误W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages 404 Not Found

使用curl我可以看到它正在重定向,但重定向到URL导致404.有没有人看到过这种行为并有补救措施?在debian进行更改之前,它基本上是不可修复的吗?

➜  ms git:(develop) curl --head http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
HTTP/1.1 302 Found
Date: Tue, 26 Mar 2019 16:03:04 GMT
Server: Apache
X-Content-Type-Options: nosniff
X-Frame-Options: sameorigin
Referrer-Policy: no-referrer
X-Xss-Protection: 1
Location: http://cdn-fastly.deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
Content-Type: text/html; charset=iso-8859-1

➜  ms git:(develop) curl --head http://cdn-fastly.deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
HTTP/1.1 404 Not Found
Server: Apache
X-Content-Type-Options: nosniff
X-Frame-Options: sameorigin
Referrer-Policy: no-referrer
X-Xss-Protection: 1
Content-Type: text/html; charset=iso-8859-1
Via: 1.1 varnish
Content-Length: 316
Accept-Ranges: bytes
Date: Tue, 26 Mar 2019 16:03:17 GMT
Via: 1.1 varnish
Age: 45
Connection: keep-alive
X-Served-By: cache-ams21028-AMS, cache-cdg20741-CDG
X-Cache: HIT, HIT
X-Cache-Hits: 6, 2
X-Timer: S1553616198.734091,VS0,VE0
docker travis-ci debian-jessie
1个回答
33
投票

这是因为

由于最近Wheezy和Jessie已经集成到archive.debian.org结构中,我们现在从镜像网络中删除所有Wheezy和Jessie的所有非LTS架构。

(你可以读到here

一个解决方案(根据https://github.com/debuerreotype/docker-debian-artifacts/issues/66#issuecomment-476616579)是添加这一行:

RUN sed -i '/jessie-updates/d' /etc/apt/sources.list  # Now archived

在使用debian:jessie调用any apt-get update之前进入你的Dockerfile。这将从sources.list中删除jessie-updates存储库(现在导致404)。

因此,虽然以下不起作用:

FROM debian:jessie
RUN apt-get update
CMD /bin/sh

它的作用如下:

FROM debian:jessie
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list  # Now archived
RUN apt-get update
CMD /bin/sh
© www.soinside.com 2019 - 2024. All rights reserved.