53

Dockerfile:

FROM maven:3.5.2-jdk-8

RUN apt-get update && \
    apt-get install -y python-dev python-pip
RUN pip install awscli --upgrade

Build Logs:

Preparing build context archive…
[==================================================>]3380/3380 files
Done

Sending build context to Docker daemon…
[==================================================>] 23.19MB
Done

Step 1/17 : FROM maven:3.5.2-jdk-8
 ---> d07bef19f01a
Step 2/17 : RUN apt-get update &&     apt-get install -y python-dev python-pip
 ---> Running in ebed1b8ce61e
Ign:1 http://security.debian.org stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease
Ign:3 http://security.debian.org stretch/updates Release
Ign:4 http://deb.debian.org/debian stretch-updates InRelease
Ign:5 http://deb.debian.org/debian stretch Release
Ign:6 http://deb.debian.org/debian stretch-updates Release
Ign:7 http://deb.debian.org/debian stretch/main arm64 Packages
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Ign:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:7 http://deb.debian.org/debian stretch/main arm64 Packages
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Ign:11 http://security.debian.org stretch/updates/main arm64 Packages
Ign:12 http://security.debian.org stretch/updates/main all Packages
Ign:11 http://security.debian.org stretch/updates/main arm64 Packages
Ign:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
Ign:12 http://security.debian.org stretch/updates/main all Packages
Ign:11 http://security.debian.org stretch/updates/main arm64 Packages
Ign:12 http://security.debian.org stretch/updates/main all Packages
Ign:11 http://security.debian.org stretch/updates/main arm64 Packages
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:7 http://deb.debian.org/debian stretch/main arm64 Packages
Ign:12 http://security.debian.org stretch/updates/main all Packages
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Ign:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:7 http://deb.debian.org/debian stretch/main arm64 Packages
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Ign:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:7 http://deb.debian.org/debian stretch/main arm64 Packages
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Ign:11 http://security.debian.org stretch/updates/main arm64 Packages
Ign:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
Ign:12 http://security.debian.org stretch/updates/main all Packages
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Err:7 http://deb.debian.org/debian stretch/main arm64 Packages
  404  Not Found
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Err:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
  404  Not Found
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Err:11 http://security.debian.org stretch/updates/main arm64 Packages
  404  Not Found
Ign:12 http://security.debian.org stretch/updates/main all Packages
Reading package lists...
W: The repository 'http://security.debian.org stretch/updates Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
E: Failed to fetch http://security.debian.org/dists/stretch/updates/main/binary-arm64/Packages  404  Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-arm64/Packages  404  Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-arm64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Error response from daemon: The command '/bin/sh -c apt-get update &&     apt-get install -y python-dev python-pip' returned a non-zero code: 100
Failed to deploy '<unknown> Dockerfile: Dockerfile': Can't retrieve image ID from build stream

This Dockerfile used to build fine and has only recently started throwing this error

1
  • 2
    Definitely use a newer base image, i.e., release upgrade your system. Commented Apr 24, 2023 at 9:02

4 Answers 4

76

Stretch has been moved to archive.debian.org, you need to update your repository configuration or better yet, use a newer base image.

To update your repository configuration, change deb.debian.org to archive.debian.org in lines referencing Stretch in /etc/apt/sources.list and files in /etc/apt/sources.list.d.

5
  • Any link to newer base images that could be used?
    – Ani Menon
    Commented Sep 20, 2023 at 18:13
  • @AniMenon take your pick, I can’t choose for you ;-). Commented Sep 20, 2023 at 19:40
  • Ok :D I was actually looking for a debian with java8 image, not maven specifically..
    – Ani Menon
    Commented Sep 22, 2023 at 7:15
  • Well, the question is about a Maven image ;-). For Debian with Java 8, use debian:unstable and install openjdk-8-jre-headless or whichever package is most appropriate; or use whatever base release of Debian you want, and add Thorsten Glaser’s backport repository (see #989736 for details). Commented Sep 22, 2023 at 7:30
  • will check that out, thanks.
    – Ani Menon
    Commented Sep 22, 2023 at 8:09
68

Thanks @stephen-kitt! I would expect them to update the docker images with this change :(

If it helps anyone we needed to update our docker image (python:3.7.3-slim) with the following change to bypass the error (while still being able to install basic packages):

RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list

at least the PGP key was left untouched...

3
  • 9
    You’re using a 4-year-old image — once a version-specific image is tagged, it’s common practice not to update it. What you should really do is switch to a newer image, e.g. 3.7.16-bullseye if you want a version-specific image, 3.7-bullseye if you want to always track the latest 3.7 image using Bullseye. Commented Apr 25, 2023 at 11:33
  • 6
    I need more lines in my sources.list in order to apt install packages like curl:RUN echo "deb http://archive.debian.org/debian stretch main" >> /etc/apt/sources.list RUN echo "deb-src http://archive.debian.org/debian stretch main" >> /etc/apt/sources.list RUN echo "deb http://archive.debian.org/debian stretch-backports main" >> /etc/apt/sources.list RUN echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list RUN echo "deb-src http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
    – Aravind
    Commented Apr 26, 2023 at 14:07
  • 1
    Better yet, use https: RUN echo "deb https://archive.debian.org/debian stretch main" > /etc/apt/sources.list Commented Apr 27, 2023 at 12:47
11

Thank you @Stephen_Kitt and @Ben_Kaplan for the helpful answers!

Inspired by them, i added the following to my Dockerfile to switch to archive.debian.org:

RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list
RUN sed -i s/security.debian.org/archive.debian.org/g /etc/apt/sources.list
RUN sed -i s/stretch-updates/stretch/g /etc/apt/sources.list

With that, all works fine and no misleading error messages pops up.

Edit: By the comment below by Scott G, this works only if there are no other sources listet thant deb.debian.org.

2
  • 2
    I don't think this is correct. You want to replace the entire sources.list file like @ben-kaplan does in his answer. Otherwise, if your sources.list file has other entries it can still cause apt update to fail. This is because if you have a security.debian.org entry for the stretch/updates distribution, this should be removed. Or if you have a deb.debian.org entry with stretch-updates, this will be replaced with the sed command to incorrectly point to archive.debian.org for the stretch-updates distribution which doesn't exist.
    – Scott G
    Commented Apr 25, 2023 at 16:49
  • @Scott G: Thank you for that hint and you are completely right. The sources.list in our docker-image don't have any entries to security.debian.org, so i didn't think that this can also be a option for others.
    – AlexF
    Commented Apr 27, 2023 at 12:33
4

For a node 12 image with similar issues I also had to add the debian security to be able to install libnotify

By adding the below lines I managed to get the docker image working again.

The first line overwrites any existing content in sources.list, the rest append tot the "new" sources file.

RUN MAJOR_VERSION=$(echo $NODE_VERSION | cut -d '.' -f 1) && \
    if [ "$MAJOR_VERSION" = "12" ] ; then \
    echo "deb [trusted=yes] http://archive.debian.org/debian stretch main non-free contrib" > /etc/apt/sources.list && \
    echo 'deb-src [trusted=yes] http://archive.debian.org/debian/ stretch main non-free contrib'  >> /etc/apt/sources.list && \
    echo 'deb [trusted=yes] http://archive.debian.org/debian-security/ stretch/updates main non-free contrib'  >> /etc/apt/sources.list; \
    fi
1
  • 1
    This should be the top answer, IMO. It doesn't give a partial answer and then 'instruct' the obvious about an old node:12 image: it just answers the question with a complete solution
    – Rondo
    Commented Oct 4, 2023 at 3:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .