PrestaShop / docker

🐳
https://hub.docker.com/r/prestashop/prestashop/
MIT License
259 stars 177 forks source link

End of support for debian stretch - Failed to fetch stretch* 404 Not Found - Need to rebuild old images to use debian strech in archive repo #337

Open maxime-morel opened 1 year ago

maxime-morel commented 1 year ago

We have the following error when using PrestaShop images using bebian strech, after running apt update:

#0 7.742 E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages  404  Not Found [IP: 151.101.66.132 80]
#0 7.742 E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages  404  Not Found
#0 7.742 E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages  404  Not Found
#0 7.742 E: Some index files failed to download. They have been ignored, or old ones used instead.

The issue is related to debian repos that removed the stretch support (which is still accessible in the archive repos).

To fix this issue, you may try rebuilding the PrestaShop Docker images should automatically update the repo to archive (as the base image is from PHP FROM php:7.1-apache, it should automatically be using the archive repo in the source list)

I was able to reproduce the issue with PS 1.5 / 1.6 / 1.7.5.5

As a workaround, we are detecting the debian version and changing the repo list:

ARG VERSION_PRESTA
FROM prestashop/prestashop:$VERSION_PRESTA

# Update apt source list (for debian stretch on old PS images using debian 9)
RUN if [ $(awk -F. '{print $1}' /etc/debian_version) -eq 9 ]; then \
  printf 'deb http://archive.debian.org/debian/ stretch main contrib non-free deb http://archive.debian.org/debian-security/ stretch/updates main contrib non-free deb http://archive.debian.org/debian/ stretch-backports main contrib non-free' > /etc/apt/sources.list; \
  fi