The problem
I'm trying to use jessie-backports in a docker repository for a Ruby on Rails project using this Dockerfile:
FROM ruby:2.4.1
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
RUN echo 'alias ll="ls --color=auto -l"' >> ~/.bashrc
RUN apt-get remove -y python
RUN apt-get update --fix-missing
RUN apt-get -y upgrade
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list && apt-get update
RUN apt-get install -y certbot -t jessie-backports
However when I attempted to build the docker image. the following error popped up in the middle of the installation:
E: Release file for http://archive.debian.org/debian/dists/jessie-backports/InRelease is expired (invalid since 77d 3h 49min 17s). Updates for this repository will not be applied.
As of March 27 Lucas Nussbaum wrote in this blogpost that jessie-updates and jessie-backports were going to be removed from Debian mirrors. The blog post I mentioned stated that what I needed to do was replace:
deb http://ftp.debian.org/debian jessie-backports main
With this other commands:
deb http://archive.debian.org/debian/ jessie-backports main contrib non-free
echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
So I changed the commands as follows:
FROM ruby:2.4.1
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
RUN echo 'alias ll="ls --color=auto -l"' >> ~/.bashrc
RUN apt-get remove -y python
RUN apt-get update --fix-missing
RUN apt-get -y upgrade
RUN echo "deb http://archive.debian.org/debian/ jessie-backports main contrib non-free" > /etc/apt/sources.list
RUN echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
RUN apt-get update
RUN apt-get install -y certbot -t jessie-backports
However the same issue is still present.
I also attempted to move the commands before any apt command like this:
FROM ruby:2.4.1
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
RUN echo 'alias ll="ls --color=auto -l"' >> ~/.bashrc
RUN echo "deb http://archive.debian.org/debian/ jessie-backports main contrib non-free" > /etc/apt/sources.list
RUN echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
RUN apt-get update
RUN apt-get remove -y python
RUN apt-get update --fix-missing
RUN apt-get -y upgrade
RUN apt-get install -y certbot -t jessie-backports
jessie-backports
line to use>>
instead of>
). ā Stephen Kitt May 09 '19 at 11:58