Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions universal/ubi10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,35 @@ cd -
rm -rf "${TEMP_DIR}"
EOF

## bubblewrap - unprivileged sandboxing tool (https://github.com/containers/bubblewrap)
## Building from source as the package requires the crb repo which needs a RHEL subscription (not available in UBI)
RUN <<'EOF'
set -euf -o pipefail

BWRAP_VERSION="0.11.2"
TEMP_DIR="$(mktemp -d)"
cd "${TEMP_DIR}"

dnf install -y meson ninja-build gcc libcap-devel

BWRAP_TGZ="bubblewrap-${BWRAP_VERSION}.tar.xz"
BWRAP_URL="https://github.com/containers/bubblewrap/releases/download/v${BWRAP_VERSION}"
curl -sSLO "${BWRAP_URL}/${BWRAP_TGZ}"
curl -sSLO "${BWRAP_URL}/${BWRAP_TGZ}.sha256sum"
sha256sum -c "${BWRAP_TGZ}.sha256sum"

tar -xf "${BWRAP_TGZ}"
cd "bubblewrap-${BWRAP_VERSION}"
meson setup build
ninja -C build
install -m 4755 build/bwrap /usr/bin/bwrap

cd /
rm -rf "${TEMP_DIR}"
dnf remove -y meson ninja-build gcc libcap-devel
dnf clean all && rm -rf /var/cache/dnf
EOF

RUN <<EOF
oc completion bash > /usr/share/bash-completion/completions/oc
tkn completion bash > /usr/share/bash-completion/completions/tkn
Expand Down
29 changes: 29 additions & 0 deletions universal/ubi9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,35 @@ cd -
rm -rf "${TEMP_DIR}"
EOF

## bubblewrap - unprivileged sandboxing tool (https://github.com/containers/bubblewrap)
## Building from source as the package requires the crb repo which needs a RHEL subscription (not available in UBI)
RUN <<'EOF'
set -euf -o pipefail

BWRAP_VERSION="0.11.2"
TEMP_DIR="$(mktemp -d)"
cd "${TEMP_DIR}"

dnf install -y meson ninja-build gcc libcap-devel

BWRAP_TGZ="bubblewrap-${BWRAP_VERSION}.tar.xz"
BWRAP_URL="https://github.com/containers/bubblewrap/releases/download/v${BWRAP_VERSION}"
curl -sSLO "${BWRAP_URL}/${BWRAP_TGZ}"
curl -sSLO "${BWRAP_URL}/${BWRAP_TGZ}.sha256sum"
sha256sum -c "${BWRAP_TGZ}.sha256sum"

tar -xf "${BWRAP_TGZ}"
cd "bubblewrap-${BWRAP_VERSION}"
meson setup build
ninja -C build
install -m 4755 build/bwrap /usr/bin/bwrap

cd /
rm -rf "${TEMP_DIR}"
dnf remove -y meson ninja-build gcc libcap-devel
dnf clean all && rm -rf /var/cache/dnf
Comment on lines +583 to +584

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

dnf remove includes gcc in both Dockerfiles — breaks the C/C++ toolchain installed earlier. Both bubblewrap blocks remove gcc via dnf remove, but gcc was installed earlier for the C/C++ toolchain (gcc gcc-c++ at Line 131 in UBI 9, Line 133 in UBI 10). Removing gcc cascades to gcc-c++ (RPM dependency) and potentially php-devel and other -devel packages, breaking the image's developer-tool contract.

  • universal/ubi9/Dockerfile#L583-L584: Remove gcc from the dnf remove list — change to dnf remove -y meson ninja-build libcap-devel.
  • universal/ubi10/Dockerfile#L616-L617: Same fix — change to dnf remove -y meson ninja-build libcap-devel.
📍 Affects 2 files
  • universal/ubi9/Dockerfile#L583-L584 (this comment)
  • universal/ubi10/Dockerfile#L616-L617
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@universal/ubi9/Dockerfile` around lines 583 - 584, Remove gcc from the dnf
remove list in both bubblewrap cleanup blocks, preserving removal of meson,
ninja-build, and libcap-devel. Update universal/ubi9/Dockerfile lines 583-584
and universal/ubi10/Dockerfile lines 616-617; no other cleanup behavior should
change.

EOF

RUN <<EOF
oc completion bash > /usr/share/bash-completion/completions/oc
tkn completion bash > /usr/share/bash-completion/completions/tkn
Expand Down
Loading