【问题标题】:apt-get update fails with 404 in a previously working buildapt-get update 在以前工作的版本中失败,出现 404
【发布时间】:2019-03-26 16:17:29
【问题描述】:

我正在运行 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】:

这是因为

因为 Wheezy 和 Jessie 已被整合到 archive.debian.org 最近的结构,我们现在正在删除所有 Wheezy 和所有非 LTS 从今天开始,来自镜像网络的 Jessie 架构。

(如你所见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

【讨论】:

  • 像魅力一样工作。谢谢!
  • 这是怎么发生的?看起来成千上万的人在其他论坛和 Git 问题跟踪器中遇到了这个问题。我有一个非常无害的 Dockerfile,它刚刚停止工作。有什么我们应该知道的以防止错误吗?还是 Debian 的人只是故意破坏每个人的容器,然后希望他们能解决这个问题?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-07-12
  • 1970-01-01
  • 2016-07-14
  • 1970-01-01
  • 1970-01-01
  • 2015-07-08
相关资源
最近更新 更多