简体   繁体   中英

Dockerfile - debian Jessie 404: packages not found

I'm trying to set up a docker container on Debian 9.8, but I keep getting the following error when I run docker-compose up -d :

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found

Which then causes the process to be cut short.

I have the following Dockerfile (shortened for readability) with 2 calls to apt-get update that I have modified with suggestions from these pages to no avail:

RUN echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie main" > /etc/apt/sources.list.d/jessie.list
RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
RUN apt-get -o Acquire::Check-Valid-Until=false update
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
RUN apt-get update

I also removed any references I could find to jessie in /etc/apt/sources/list . What am I missing?

EDIT I didn't realise there were multipls dockerfiles in the project, so I edited all of them one by one. That said, is there a way of centralizing the process?

I ran the following without issue:

$ cat df.jessie-updates
FROM python:3.5.2
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
RUN apt-get update \
 && apt-get install -y git

$ DOCKER_BUILDKIT=0 docker build -f df.jessie-updates -t test-jessie-updates .
Sending build context to Docker daemon  23.04kB
Step 1/3 : FROM python:3.5.2
 ---> 432d0c6d4d9a
Step 2/3 : RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
 ---> Running in f2a056c4c0f2
Removing intermediate container f2a056c4c0f2
 ---> 07fff7724882
Step 3/3 : RUN apt-get update  && apt-get install -y git
 ---> Running in a862679899c0
Ign http://deb.debian.org jessie InRelease
Get:1 http://deb.debian.org jessie Release.gpg [2420 B]
Get:2 http://deb.debian.org jessie Release [148 kB]
Get:3 http://security.debian.org jessie/updates InRelease [44.9 kB]
Get:4 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Get:5 http://security.debian.org jessie/updates/main amd64 Packages [825 kB]
Fetched 10.1 MB in 8s (1130 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  gettext-base git-daemon-run git-daemon-sysvinit git-doc git-el git-email
  git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn
Recommended packages:
  less rsync
The following packages will be upgraded:
  git
1 upgraded, 0 newly installed, 0 to remove and 161 not upgraded.
Need to get 3709 kB of archives.
After this operation, 371 kB of additional disk space will be used.
Get:1 http://security.debian.org/ jessie/updates/main git amd64 1:2.1.4-2.1+deb8u7 [3709 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 3709 kB in 2s (1557 kB/s)
(Reading database ... 21602 files and directories currently installed.)
Preparing to unpack .../git_1%3a2.1.4-2.1+deb8u7_amd64.deb ...
Unpacking git (1:2.1.4-2.1+deb8u7) over (1:2.1.4-2.1+deb8u2) ...
Setting up git (1:2.1.4-2.1+deb8u7) ...
Removing intermediate container a862679899c0
 ---> fc422b5b9188
Successfully built fc422b5b9188
Successfully tagged test-jessie-updates

This is based off of your second link which you described as not working. If you have a MCVE including a minimal and complete dockerfile, and the full output from running a build, that may help us debug further.

Any one who might be facing this issue jessie-update fails or jessie-backports fail, this solution worked for me.

 RUN echo 'deb http://archive.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list
 RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
 RUN apt-get -o Acquire::Check-Valid-Until=false update`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM