Skip to content

Commit ca1c166

Browse files
authored
fix: make bubblewrap conditionally installed for RedHat-based images (#1651)
* Initial plan * fix: make bubblewrap conditionally installed on RedHat-based systems bubblewrap is not available in UBI repositories, causing common-utils installation to fail on UBI base images. This change checks package availability before adding bubblewrap to the install list, following the same pattern used for compat-openssl10 and redhat-lsb-core. Also adds a test scenario for UBI 8 image. * chore: bump common-utils version to 2.5.9 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent f5bfe12 commit ca1c166

4 files changed

Lines changed: 29 additions & 2 deletions

File tree

src/common-utils/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "common-utils",
3-
"version": "2.5.8",
3+
"version": "2.5.9",
44
"name": "Common Utilities",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils",
66
"description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",

src/common-utils/main.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,13 @@ install_redhat_packages() {
216216
which \
217217
man-db \
218218
strace \
219-
bubblewrap \
220219
socat"
221220

221+
# Install bubblewrap if available (not present in UBI repositories)
222+
if ${install_cmd} -q list bubblewrap >/dev/null 2>&1; then
223+
package_list="${package_list} bubblewrap"
224+
fi
225+
222226
# rockylinux:9 installs 'curl-minimal' which clashes with 'curl'
223227
# Install 'curl' for every OS except this rockylinux:9
224228
if [[ "${ID}" = "rocky" ]] && [[ "${VERSION}" != *"9."* ]]; then

test/common-utils/scenarios.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,12 @@
284284
"features": {
285285
"common-utils": {}
286286
}
287+
},
288+
"ubi-8": {
289+
"image": "registry.access.redhat.com/ubi8/ubi:8.10",
290+
"remoteUser": "devcontainer",
291+
"features": {
292+
"common-utils": {}
293+
}
287294
}
288295
}

test/common-utils/ubi-8.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
. /etc/os-release
10+
check "non-root user" test "$(whoami)" = "devcontainer"
11+
check "distro" test "${PLATFORM_ID}" = "platform:el8"
12+
check "curl" curl --version
13+
check "jq" jq --version
14+
15+
# Report result
16+
reportResults

0 commit comments

Comments
 (0)