Issue with fetching http://deb.debian.org/debian/dists/jessie-updates/InRelease with docker

80

17

Im trying to run the command docker-compose build

I get this output:

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

Anyone who has an idea?

Pajala

Posted 2019-04-09T21:09:36.433

Reputation: 905

2

Possible duplicate of apt-get update is failing in debian

– user1686 – 2019-04-09T21:18:44.353

It says file does not exist.. Even the folder "apt" is not there, under /etc – Pajala – 2019-04-09T21:34:50.417

Your system doesn't have or need it; the Docker container you're building does. – user1686 – 2019-04-10T03:52:57.993

Answers

133

I ran into this problem too this morning. I was able to solve it by combining advice from the following two tickets:

How to solve 404 Error in AWS apg-get for debian jessie fetch?

https://stackoverflow.com/questions/46406847/docker-how-to-add-backports-to-sources-list-via-dockerfile

The solution:

In your Dockerfile, before running any apt commands, add the following line:

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

This enables apt to run from the new sources.

It's possible the debian:jesse Docker image will be updated to work correctly in the near future, but until then this will allow you to keep working

Ben Hillier

Posted 2019-04-09T21:09:36.433

Reputation: 1 465

3Thanks! Just ran into the same issue today. This seemed to work in my case. – Giel Berkers – 2019-04-10T12:50:52.000

1

Note that https://superuser.com/a/1424377/172047 does not require any change in your Dockerfile

– xverges – 2019-04-25T15:50:58.377

1

Worked for me, but needed do add dns as mentioned in https://stackoverflow.com/questions/24991136/docker-build-could-not-resolve-archive-ubuntu-com-apt-get-fails-to-install-a

– Ricardo Rivaldo – 2019-05-13T18:40:52.610

1jessie-updates was merged into jessie. Keeping it was useless. Jessie is still supported via security.debian.org. More on it here. Or see this answer. – x-yuri – 2019-06-16T23:28:18.863

21

The debian team has fixed it. Pulling the image again so that it gets updated fixed it for me:

docker pull debian:jessie

Warning from the linked ticket:

Also, please migrate off Jessie ASAP -- the clock is ticking!!

xverges

Posted 2019-04-09T21:09:36.433

Reputation: 361

If this fix does not work, try docker pull debian:8 – dddJewelsbbb – 2019-05-31T15:37:23.973

5

My solution

Quick workaround

Overwritting sources.list is not what I want:

sed '/jessie-updates/s/^/# /' -i /etc/apt/sources.list

will just comment lines containing jessie-updates and keep everything else!

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

So I continue to use local mirrors while Debian jessie stay supported.

Upgrade to stretch

Then for upgrading to stretch, I just

sed 's/jessie/stretch/' -i.jessie /etc/apt/sources.list

This will create a source.list.jessie

then I can uncomment stretch-updates lines:

sed '/stretch-updates/s/^# //' -i /etc/apt/sources.list

F. Hauri

Posted 2019-04-09T21:09:36.433

Reputation: 1 394

1

The better solution would be to use build-pack images in your docker containers for jessie so you can do something like :

FROM buildpack-deps:jessie

You can get them here

Xavier Fox

Posted 2019-04-09T21:09:36.433

Reputation: 11