apt-get update fails with 404 in a previously working build

陌路散爱 提交于 2019-11-27 09:40:53

This is due to the fact that

as Wheezy and Jessie have been integrated into the archive.debian.org structure recently, we are now removing all of Wheezy and all non-LTS architectures of Jessie from the mirror network starting today.

(As you can read here)

A solution (according to https://github.com/debuerreotype/docker-debian-artifacts/issues/66#issuecomment-476616579) is to add this line:

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

into your Dockerfile before calling any apt-get update when using debian:jessie. This will remove the jessie-updates repository (which now causes the 404) from sources.list.

So while the following doesn't work:

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

It works like:

FROM debian:jessie
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list  # Now archived
RUN apt-get update
CMD /bin/sh
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!