From d9e617505e76ab5fd0d0842a5a7e366a3e1e0afb Mon Sep 17 00:00:00 2001 From: "Kovacs, Gergo Ferenc" Date: Thu, 3 Oct 2024 11:29:09 +0200 Subject: [PATCH] dbld: Update docker container before installing packages to avoid out of date pacakges to break the image build Signed-off-by: Kovacs, Gergo Ferenc --- dbld/builddeps | 15 +++++++++++++++ dbld/images/almalinux-8.dockerfile | 1 + dbld/images/almalinux-9.dockerfile | 1 + dbld/images/centos-7.dockerfile | 1 + dbld/images/debian-bookworm.dockerfile | 1 + dbld/images/debian-bullseye.dockerfile | 1 + dbld/images/debian-sid.dockerfile | 1 + dbld/images/debian-testing.dockerfile | 1 + dbld/images/fedora-39.dockerfile | 1 + dbld/images/fedora-40.dockerfile | 1 + dbld/images/ubuntu-focal.dockerfile | 1 + dbld/images/ubuntu-jammy.dockerfile | 1 + dbld/images/ubuntu-lunar.dockerfile | 1 + dbld/images/ubuntu-mantic.dockerfile | 1 + dbld/images/ubuntu-noble.dockerfile | 1 + 15 files changed, 29 insertions(+) diff --git a/dbld/builddeps b/dbld/builddeps index ef7f79e0f6..639b08f177 100755 --- a/dbld/builddeps +++ b/dbld/builddeps @@ -10,6 +10,21 @@ APT_INSTALL="apt-get install -y --no-install-recommends" set -e set -x +function update_packages() { + case "${OS_DISTRIBUTION}" in + centos|almalinux) + yum update -y + ;; + debian|ubuntu) + apt-get update + apt-get upgrade -y + ;; + fedora) + dnf upgrade -y + ;; + esac +} + function workaround_rpm_repos() { MIRROR_URL='https://ftp.halifax.rwth-aachen.de/fedora/linux' case "${OS_DISTRIBUTION}" in diff --git a/dbld/images/almalinux-8.dockerfile b/dbld/images/almalinux-8.dockerfile index 979ae88b8e..396ffe811a 100644 --- a/dbld/images/almalinux-8.dockerfile +++ b/dbld/images/almalinux-8.dockerfile @@ -11,6 +11,7 @@ LABEL COMMIT=${COMMIT} COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps add_epel_repo RUN /dbld/builddeps add_copr_repo diff --git a/dbld/images/almalinux-9.dockerfile b/dbld/images/almalinux-9.dockerfile index dd8cc8d085..14e6ae6013 100644 --- a/dbld/images/almalinux-9.dockerfile +++ b/dbld/images/almalinux-9.dockerfile @@ -11,6 +11,7 @@ LABEL COMMIT=${COMMIT} COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps add_epel_repo RUN /dbld/builddeps add_copr_repo diff --git a/dbld/images/centos-7.dockerfile b/dbld/images/centos-7.dockerfile index 1ff2f931e2..eb98cbd1c9 100644 --- a/dbld/images/centos-7.dockerfile +++ b/dbld/images/centos-7.dockerfile @@ -11,6 +11,7 @@ LABEL COMMIT=${COMMIT} COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps add_epel_repo RUN /dbld/builddeps add_copr_repo diff --git a/dbld/images/debian-bookworm.dockerfile b/dbld/images/debian-bookworm.dockerfile index d3d7d85213..027147240d 100644 --- a/dbld/images/debian-bookworm.dockerfile +++ b/dbld/images/debian-bookworm.dockerfile @@ -15,6 +15,7 @@ ENV LANG C.UTF-8 COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps install_apt_packages RUN /dbld/builddeps install_debian_build_deps diff --git a/dbld/images/debian-bullseye.dockerfile b/dbld/images/debian-bullseye.dockerfile index d82c616df5..bdd9299104 100644 --- a/dbld/images/debian-bullseye.dockerfile +++ b/dbld/images/debian-bullseye.dockerfile @@ -15,6 +15,7 @@ ENV LANG C.UTF-8 COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps install_apt_packages RUN /dbld/builddeps install_debian_build_deps diff --git a/dbld/images/debian-sid.dockerfile b/dbld/images/debian-sid.dockerfile index 13c75552d5..374cbc50fd 100644 --- a/dbld/images/debian-sid.dockerfile +++ b/dbld/images/debian-sid.dockerfile @@ -15,6 +15,7 @@ ENV LANG C.UTF-8 COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps install_apt_packages RUN /dbld/builddeps install_debian_build_deps diff --git a/dbld/images/debian-testing.dockerfile b/dbld/images/debian-testing.dockerfile index 73e5cf741c..bb99d4587c 100644 --- a/dbld/images/debian-testing.dockerfile +++ b/dbld/images/debian-testing.dockerfile @@ -15,6 +15,7 @@ ENV LANG C.UTF-8 COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps install_apt_packages RUN /dbld/builddeps install_debian_build_deps diff --git a/dbld/images/fedora-39.dockerfile b/dbld/images/fedora-39.dockerfile index 16342994bf..54454d99d7 100644 --- a/dbld/images/fedora-39.dockerfile +++ b/dbld/images/fedora-39.dockerfile @@ -11,6 +11,7 @@ LABEL COMMIT=${COMMIT} COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps workaround_rpm_repos RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps add_copr_repo diff --git a/dbld/images/fedora-40.dockerfile b/dbld/images/fedora-40.dockerfile index bb5623cac6..3e28899c9f 100644 --- a/dbld/images/fedora-40.dockerfile +++ b/dbld/images/fedora-40.dockerfile @@ -11,6 +11,7 @@ LABEL COMMIT=${COMMIT} COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps workaround_rpm_repos RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps add_copr_repo diff --git a/dbld/images/ubuntu-focal.dockerfile b/dbld/images/ubuntu-focal.dockerfile index 611d528010..cf1901cbda 100644 --- a/dbld/images/ubuntu-focal.dockerfile +++ b/dbld/images/ubuntu-focal.dockerfile @@ -15,6 +15,7 @@ ENV LANG C.UTF-8 COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps install_apt_packages RUN /dbld/builddeps install_debian_build_deps diff --git a/dbld/images/ubuntu-jammy.dockerfile b/dbld/images/ubuntu-jammy.dockerfile index fdcffd3d2a..ff893132e7 100644 --- a/dbld/images/ubuntu-jammy.dockerfile +++ b/dbld/images/ubuntu-jammy.dockerfile @@ -15,6 +15,7 @@ ENV LANG C.UTF-8 COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps install_apt_packages RUN /dbld/builddeps install_debian_build_deps diff --git a/dbld/images/ubuntu-lunar.dockerfile b/dbld/images/ubuntu-lunar.dockerfile index d5ccd716b8..a729d21b09 100644 --- a/dbld/images/ubuntu-lunar.dockerfile +++ b/dbld/images/ubuntu-lunar.dockerfile @@ -15,6 +15,7 @@ ENV LANG C.UTF-8 COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps install_apt_packages RUN /dbld/builddeps install_debian_build_deps diff --git a/dbld/images/ubuntu-mantic.dockerfile b/dbld/images/ubuntu-mantic.dockerfile index 74b0abd234..9f23253819 100644 --- a/dbld/images/ubuntu-mantic.dockerfile +++ b/dbld/images/ubuntu-mantic.dockerfile @@ -15,6 +15,7 @@ ENV LANG C.UTF-8 COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps install_apt_packages RUN /dbld/builddeps install_debian_build_deps diff --git a/dbld/images/ubuntu-noble.dockerfile b/dbld/images/ubuntu-noble.dockerfile index 27e6b27910..a8631d85dc 100644 --- a/dbld/images/ubuntu-noble.dockerfile +++ b/dbld/images/ubuntu-noble.dockerfile @@ -15,6 +15,7 @@ ENV LANG C.UTF-8 COPY images/entrypoint.sh / COPY . /dbld/ +RUN /dbld/builddeps update_packages RUN /dbld/builddeps install_dbld_dependencies RUN /dbld/builddeps install_apt_packages RUN /dbld/builddeps install_debian_build_deps