From 1f09ca26eb2eb820cde1fc459025fb06d8b4b448 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 19 Dec 2023 10:03:45 +0100 Subject: [PATCH] build: create /etc/selinux/config in case it is missing Sometimes the Ceph container images seem to have a broken scriptlet while installing/updating Ceph packages. It is relatively common for them to fail when `/etc/selinux/config` does not exist. By ensuring the file directory and file exist (even if empty), the package installation or upgrades succeed. Signed-off-by: Niels de Vos --- deploy/cephcsi/image/Dockerfile | 2 ++ scripts/Dockerfile.devel | 2 ++ scripts/Dockerfile.test | 2 ++ 3 files changed, 6 insertions(+) diff --git a/deploy/cephcsi/image/Dockerfile b/deploy/cephcsi/image/Dockerfile index b829e9060..52c2462cf 100644 --- a/deploy/cephcsi/image/Dockerfile +++ b/deploy/cephcsi/image/Dockerfile @@ -10,6 +10,8 @@ FROM ${BASE_IMAGE} as updated_base RUN dnf config-manager --disable \ tcmu-runner,tcmu-runner-source,tcmu-runner-noarch,ceph-iscsi,ganesha || true +RUN mkdir /etc/selinux || true && touch /etc/selinux/config + RUN dnf -y update --nobest \ && dnf -y install nfs-utils \ && dnf clean all \ diff --git a/scripts/Dockerfile.devel b/scripts/Dockerfile.devel index ba6e9fb71..8ecbd2432 100644 --- a/scripts/Dockerfile.devel +++ b/scripts/Dockerfile.devel @@ -23,6 +23,8 @@ RUN source /build.env \ RUN dnf config-manager --disable \ tcmu-runner,tcmu-runner-source,tcmu-runner-noarch,ceph-iscsi,ganesha || true +RUN mkdir /etc/selinux || true && touch /etc/selinux/config + RUN dnf -y install \ git \ make \ diff --git a/scripts/Dockerfile.test b/scripts/Dockerfile.test index d54049e38..5b03911c7 100644 --- a/scripts/Dockerfile.test +++ b/scripts/Dockerfile.test @@ -23,6 +23,8 @@ ENV \ COPY build.env / +RUN mkdir /etc/selinux || true && touch /etc/selinux/config + RUN source /build.env \ && \ ( test -n "${GOARCH}" && exit 0; echo -e "\n\nMissing GOARCH argument for building image, install Golang or run: make containerized-test GOARCH=amd64\n\n"; exit 1 ) \