From b217e38904da3ccab6eb96251376f1635ee55d21 Mon Sep 17 00:00:00 2001
From: Monty Taylor <mordred@inaugust.com>
Date: Fri, 9 Jul 2021 19:24:01 -0500
Subject: [PATCH] Add backports repos to base and builder images

These don't install anything by default, but allow people
to easily opt-in to a backport package if they need to without
lots of extra lines of boilerplate.

The base python image is on bullseye now instead of buster. That
means the libffi version is 7 not 6.

Change-Id: I0e0c2669d838fb622422f696f73e96e409157270
---
 docker/python-base/Dockerfile    | 3 ++-
 docker/python-builder/Dockerfile | 3 ++-
 docker/uwsgi-base/bindep.txt     | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/docker/python-base/Dockerfile b/docker/python-base/Dockerfile
index a0f588c1f8..e7588c7459 100644
--- a/docker/python-base/Dockerfile
+++ b/docker/python-base/Dockerfile
@@ -23,7 +23,8 @@ RUN echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/95disable-recommen
 RUN apt-get update \
   && apt-get install -y dumb-init \
   && apt-get clean \
-  && rm -rf /var/lib/apt/lists/*
+  && rm -rf /var/lib/apt/lists/* \
+  && echo 'deb http://deb.debian.org/debian bullseye-backports main' >> /etc/apt/sources.list
 
 # Upgrade pip to fix wheel cache for locally built wheels.
 # See https://github.com/pypa/pip/issues/6852
diff --git a/docker/python-builder/Dockerfile b/docker/python-builder/Dockerfile
index 63257082cd..e45163de1a 100644
--- a/docker/python-builder/Dockerfile
+++ b/docker/python-builder/Dockerfile
@@ -36,7 +36,8 @@ COPY scripts/install-from-bindep /output/install-from-bindep
 RUN dpkg -i /tmp/python3-dev_4.0.0_all.deb \
   && rm /tmp/python3-dev_4.0.0_all.deb \
   && pip install --no-cache-dir bindep \
-  && rm -rf /var/lib/apt/lists/*
+  && rm -rf /var/lib/apt/lists/* \
+  && echo 'deb http://deb.debian.org/debian bullseye-backports main' >> /etc/apt/sources.list
 
 # Upgrade pip to fix wheel cache for locally built wheels
 # See https://github.com/pypa/pip/issues/6852
diff --git a/docker/uwsgi-base/bindep.txt b/docker/uwsgi-base/bindep.txt
index 670f7d05a7..db53d4bea3 100644
--- a/docker/uwsgi-base/bindep.txt
+++ b/docker/uwsgi-base/bindep.txt
@@ -1,5 +1,5 @@
 gcc [compile]
 libc6-dev [compile]
 libffi-dev [compile platform:dpkg]
-libffi6 [platform:dpkg]
+libffi7 [platform:dpkg]
 libssl-dev [compile platform:dpkg]