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

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?

Answer

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

Attribution
Source : Link , Question Author : Pajala , Answer Author : Ben Hillier

Leave a Comment