From 61e7e8ad2d8f887b079a63d6d6953c132364aa91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 23 Jan 2025 15:05:50 +0100 Subject: [PATCH] Use runtime dependency files for each Debian version Generalize dockerfiles by using the runtime dependency files for every used Debian version. --- .docker/prod-oldstable.Dockerfile | 24 +++++------------- .docker/prod-testing.Dockerfile | 25 +++++-------------- .docker/prod.Dockerfile | 3 ++- .github/runtime-dependencies.oldstable.list | 14 +++++++++++ ....list => runtime-dependencies.stable.list} | 0 .github/runtime-dependencies.testing.list | 15 +++++++++++ 6 files changed, 43 insertions(+), 38 deletions(-) create mode 100644 .github/runtime-dependencies.oldstable.list rename .github/{runtime-dependencies.list => runtime-dependencies.stable.list} (100%) create mode 100644 .github/runtime-dependencies.testing.list diff --git a/.docker/prod-oldstable.Dockerfile b/.docker/prod-oldstable.Dockerfile index a3424168..42dade80 100644 --- a/.docker/prod-oldstable.Dockerfile +++ b/.docker/prod-oldstable.Dockerfile @@ -4,31 +4,19 @@ ARG DEBIAN_FRONTEND=noninteractive # Install COPY . /source -RUN sh /source/.github/install-dependencies.sh /source/.github/build-dependencies.list \ +RUN sh /source/.github/install-dependencies.sh \ + /source/.github/build-dependencies.list \ && rm -rf /var/lib/apt/lists/* RUN cmake -DCMAKE_BUILD_TYPE=Release -DOPENVASD=0 -B/build /source \ - && DESTDIR=/install cmake --build /build -- install + && DESTDIR=/install cmake --build /build -j$(nproc) -- install FROM debian:oldstable-slim ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - libcjson1 \ - libgcrypt20 \ - libglib2.0-0 \ - libgnutls30 \ - libgpgme11 \ - libhiredis0.14 \ - libldap-common \ - libnet1 \ - libpaho-mqtt1.3 \ - libpcap0.8 \ - libradcli4 \ - libssh-4 \ - libuuid1 \ - libxml2 \ +RUN --mount=type=bind,source=.github,target=/source/ \ + sh /source/install-dependencies.sh \ + /source/runtime-dependencies.oldstable.list \ && rm -rf /var/lib/apt/lists/* COPY --from=build /install/ / diff --git a/.docker/prod-testing.Dockerfile b/.docker/prod-testing.Dockerfile index 352bc543..6076190c 100644 --- a/.docker/prod-testing.Dockerfile +++ b/.docker/prod-testing.Dockerfile @@ -4,32 +4,19 @@ ARG DEBIAN_FRONTEND=noninteractive # Install COPY . /source -RUN sh /source/.github/install-dependencies.sh /source/.github/build-dependencies.list \ +RUN sh /source/.github/install-dependencies.sh \ + /source/.github/build-dependencies.list \ && rm -rf /var/lib/apt/lists/* RUN cmake -DCMAKE_BUILD_TYPE=Release -B/build /source \ - && DESTDIR=/install cmake --build /build -- install + && DESTDIR=/install cmake --build /build -j$(nproc) -- install FROM debian:testing-slim ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - libcjson1 \ - libcurl3t64-gnutls \ - libgcrypt20 \ - libglib2.0-0 \ - libgnutls30 \ - libgpgme11 \ - libhiredis1.1.0 \ - libldap-common \ - libnet1 \ - libpaho-mqtt1.3 \ - libpcap0.8 \ - libradcli4 \ - libssh-4 \ - libuuid1 \ - libxml2 \ +RUN --mount=type=bind,source=.github,target=/source/ \ + sh /source/install-dependencies.sh \ + /source/runtime-dependencies.testing.list \ && rm -rf /var/lib/apt/lists/* COPY --from=build /install/ / diff --git a/.docker/prod.Dockerfile b/.docker/prod.Dockerfile index f1ca6b70..afae8934 100644 --- a/.docker/prod.Dockerfile +++ b/.docker/prod.Dockerfile @@ -15,7 +15,8 @@ FROM debian:stable-slim ARG DEBIAN_FRONTEND=noninteractive RUN --mount=type=bind,source=.github,target=/source/ \ - sh /source/install-dependencies.sh /source/runtime-dependencies.list \ + sh /source/install-dependencies.sh \ + /source/runtime-dependencies.stable.list \ && rm -rf /var/lib/apt/lists/* COPY --from=build /install/ / diff --git a/.github/runtime-dependencies.oldstable.list b/.github/runtime-dependencies.oldstable.list new file mode 100644 index 00000000..9b4432ea --- /dev/null +++ b/.github/runtime-dependencies.oldstable.list @@ -0,0 +1,14 @@ +libcjson1 +libgcrypt20 +libglib2.0-0 +libgnutls30 +libgpgme11 +libhiredis0.14 +libldap-common +libnet1 +libpaho-mqtt1.3 +libpcap0.8 +libradcli4 +libssh-4 +libuuid1 +libxml2 diff --git a/.github/runtime-dependencies.list b/.github/runtime-dependencies.stable.list similarity index 100% rename from .github/runtime-dependencies.list rename to .github/runtime-dependencies.stable.list diff --git a/.github/runtime-dependencies.testing.list b/.github/runtime-dependencies.testing.list new file mode 100644 index 00000000..7ec68cba --- /dev/null +++ b/.github/runtime-dependencies.testing.list @@ -0,0 +1,15 @@ +libcjson1 +libcurl3t64-gnutls +libgcrypt20 +libglib2.0-0 +libgnutls30 +libgpgme11 +libhiredis1.1.0 +libldap-common +libnet1 +libpaho-mqtt1.3 +libpcap0.8 +libradcli4 +libssh-4 +libuuid1 +libxml2