Skip to content

Commit 07149e8

Browse files
committed
Fix for microdnf segfault
Signed-off-by: Riccardo Pittau <elfosardo@gmail.com>
1 parent 06bb350 commit 07149e8

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@ ENV UPPER_CONSTRAINTS_FILE=${UPPER_CONSTRAINTS_FILE} \
3737
SETUPTOOLS_VERSION=${SETUPTOOLS_VERSION}
3838

3939
RUN --mount=type=cache,sharing=locked,target=/var/cache/dnf \
40-
echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \
41-
echo "tsflags=nodocs" >> /etc/dnf/dnf.conf && \
42-
echo "keepcache=1" >> /etc/dnf/dnf.conf && \
40+
# 1. Immediate GPG fix to prevent Segfaults
41+
rm -f /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial-PQC && \
42+
# 2. Configure DNF behavior via CLI and file
43+
sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/*.repo && \
44+
echo -e "install_weak_deps=0\ntsflags=nodocs\nkeepcache=1" >> /etc/dnf/dnf.conf && \
45+
# 3. Install core build tools
4346
microdnf install -y \
4447
gcc \
4548
python3.12-devel \
4649
python3.12-pip \
47-
python3.12-setuptools
50+
python3.12-setuptools && \
51+
microdnf clean all
4852

4953
COPY ${UPPER_CONSTRAINTS_FILE} ironic-deps-list /tmp/
5054
COPY build-wheels.sh /bin/

prepare-image.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
set -euxo pipefail
44

5+
# Fix for Segfault (Signal 11) on modern hosts
6+
# Removes SHA1/V6 keys that crash microdnf/GLib during teardown
7+
rm -f /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras
8+
rm -f /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial-PQC
9+
# Disable GPG check globally to prevent microdnf from choking on missing keys
10+
sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/*.repo
11+
512
cat >> /etc/dnf/dnf.conf<< EOF
613
install_weak_deps=False
714
tsflags=nodocs

0 commit comments

Comments
 (0)