From f85fc2c8d47ce7162b362c0bfa0feaacb167292d Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 28 Sep 2024 20:02:38 +0200 Subject: [PATCH] docker: Enforce sorted requirements at build time --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f2f22675..3a3b4b85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,15 @@ RUN cd /tmp/app \ && \ diff -u0 \ <(sed -e '/--hash=/d' -e 's/ \\$//' -e '/^#/d' -e '/^$/d' requirements-*.txt | sort -f) \ - <(pip3 freeze | sed -e '/^setuptools==/d' -e '/^wheel==/d' | sort -f) + <(pip3 freeze | sed -e '/^setuptools==/d' -e '/^wheel==/d' | sort -f) \ + && \ + diff -u1 \ + <(grep == requirements-direct.txt | sed 's,==.*,,') \ + <(grep == requirements-direct.txt | sed 's,==.*,,' | sort -f) \ + && \ + diff -u1 \ + <(grep == requirements-indirect.txt | sed 's,==.*,,') \ + <(grep == requirements-indirect.txt | sed 's,==.*,,' | sort -f) USER root RUN apk upgrade --update