Building Dockerfiles based on old Debian
July 31, 2025
Today i was trying to build a dockerfile based on an old version of debian but it failed because when i tried to use apt to install some extra software all request returned 404s. In particular php:7.1-apache which is based on buster.
This is something documented on the debian wiki whenever a version reaches EOL, but it took me a few minutes and i know that in the future it will bite me again. So a post it is.
The solution its to put this extra line in your Dockerfile according to your debian version before any apt command.
RUN echo "deb http://archive.debian.org/debian buster main" > /etc/apt/sources.list
Leave your comment on the github issue, sending me an email or DMing me on twitter