Skip to content

Commit 114a16a

Browse files
committed
fix: install ca-certificates with rpm --noscripts to avoid QEMU issues
The ca-certificates package scriptlets fail under ARM64 QEMU emulation when using dnf --installroot because scriptlets cannot find /bin/sh in the chroot environment. Solution: 1. Install core packages (filesystem, bash, python, procps-ng) with dnf - These scriptlets work fine with --installroot 2. Download ca-certificates package separately 3. Install ca-certificates using rpm with --noscripts flag - Bypasses scriptlet execution entirely - Package files are installed correctly - Avoids QEMU emulation scriptlet failures Tested locally: rpm --noscripts approach successfully installs ca-certificates without errors. Fixes multiplatform build failures in PR #1166 Signed-off-by: Manav Gupta <[email protected]>
1 parent 7ddacb0 commit 114a16a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Containerfile.lite

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,25 @@ RUN python3 -OO -m compileall -q /app/.venv /app/mcpgateway /app/plugins \
108108
# ----------------------------------------------------------------------------
109109
# Build a minimal, fully-patched rootfs containing only the runtime Python
110110
# Include ca-certificates for HTTPS connections
111+
# Note: ca-certificates installed separately to avoid scriptlet issues with QEMU
111112
# ----------------------------------------------------------------------------
112113
# hadolint ignore=DL3041
113114
RUN set -euo pipefail \
114115
&& mkdir -p "${ROOTFS_PATH:?}" \
115116
&& dnf --installroot="${ROOTFS_PATH:?}" --releasever=10 upgrade -y \
116-
&& dnf --installroot="${ROOTFS_PATH:?}" --releasever=10 install -y \
117+
&& dnf --installroot="${ROOTFS_PATH:?}" \
118+
--releasever=10 \
117119
--setopt=install_weak_deps=0 \
118120
--setopt=tsflags=nodocs \
119121
--setopt=skip_if_unavailable=1 \
122+
install -y \
120123
filesystem \
121124
bash \
122-
&& dnf --installroot="${ROOTFS_PATH:?}" --releasever=10 install -y \
123-
--setopt=install_weak_deps=0 \
124-
--setopt=tsflags=nodocs,noscripts \
125-
--setopt=skip_if_unavailable=1 \
126125
python${PYTHON_VERSION} \
127-
ca-certificates \
128126
procps-ng \
127+
&& dnf download --installroot="${ROOTFS_PATH:?}" --releasever=10 ca-certificates \
128+
&& rpm --root="${ROOTFS_PATH:?}" --install --nodeps --noscripts ca-certificates-*.rpm \
129+
&& rm -f ca-certificates-*.rpm \
129130
&& dnf clean all --installroot="${ROOTFS_PATH:?}"
130131

131132
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)