Issue with fetching http://deb.debian.org/debian/dists/jessie-updates/InRelease with docker
Andrew Mclaughlin
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 stable InRelease
Get:1 jessie/updates InRelease [44.9 kB]
.....
Get:9 jessie/main amd64 Packages [9098 kB]
W: Fetched 10.1 MB in 6s (1519 kB/s)
Failed to fetch 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: 100Anyone who has an idea?
44 Answers
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?
The solution:
In your Dockerfile, before running any apt commands, add the following line:
RUN printf "deb jessie main\ndeb-src jessie main\ndeb jessie/updates main\ndeb-src jessie/updates main" > /etc/apt/sources.listThis 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
The debian team has fixed it. Pulling the image again so that it gets updated fixed it for me:
docker pull debian:jessieWarning from the linked ticket:
1Also, please migrate off Jessie ASAP -- the clock is ticking!!
My solution
Quick workaround
Overwritting sources.list is not what I want:
sed '/jessie-updates/s/^/# /' -i /etc/apt/sources.listwill just comment lines containing jessie-updates and keep everything else!
deb jessie main contrib deb-src jessie main contrib deb jessie/updates main contrib deb-src jessie/updates main contrib # # jessie-updates, previously known as 'volatile' # deb jessie-updates main contrib # deb-src 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.listThis will create a source.list.jessie
then I can uncomment stretch-updates lines:
sed '/stretch-updates/s/^# //' -i /etc/apt/sources.list 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:jessieYou can get them here