diff --git a/src/common-utils/NOTES.md b/src/common-utils/NOTES.md index 041743887..c0618e3e9 100644 --- a/src/common-utils/NOTES.md +++ b/src/common-utils/NOTES.md @@ -12,7 +12,7 @@ In addition to the common CLI tools (curl, wget, git, jq, nano, vim, etc.), this - **iptables** - tools for configuring packet filtering and NAT rules used by sandbox networking. - **socat** — a multipurpose relay for bidirectional data transfer between two independent data channels (e.g., sockets, files, pipes). -On RPM-based distributions, bubblewrap and slirp4netns are installed only when available in the configured repositories. +On RPM-based distributions, bubblewrap and slirp4netns are installed only when available in the configured repositories. iptables is not installed on EL10 images because it is not available in UBI 10 minimal. ## Using with dev container images diff --git a/src/common-utils/devcontainer-feature.json b/src/common-utils/devcontainer-feature.json index 6f7d890e1..ec549b564 100644 --- a/src/common-utils/devcontainer-feature.json +++ b/src/common-utils/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "common-utils", - "version": "2.7.1", + "version": "2.7.2", "name": "Common Utilities", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils", "description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.", diff --git a/src/common-utils/main.sh b/src/common-utils/main.sh index 200687920..852a87cd8 100644 --- a/src/common-utils/main.sh +++ b/src/common-utils/main.sh @@ -223,9 +223,13 @@ install_redhat_packages() { man-db \ strace \ util-linux \ - iptables \ socat" + # UBI 10 minimal does not provide iptables. + if [[ "${ID}" != "rhel" || "${VERSION_ID}" != 10* ]]; then + package_list="${package_list} iptables" + fi + # rockylinux:9 installs 'curl-minimal' which clashes with 'curl' # Install 'curl' for every OS except this rockylinux:9 if [[ "${ID}" = "rocky" ]] && [[ "${VERSION}" != *"9."* ]]; then diff --git a/test/common-utils/scenarios.json b/test/common-utils/scenarios.json index 8fcc68c59..324a458c9 100644 --- a/test/common-utils/scenarios.json +++ b/test/common-utils/scenarios.json @@ -339,5 +339,12 @@ "features": { "common-utils": {} } + }, + "ubi-10-minimal": { + "image": "registry.access.redhat.com/ubi10/ubi-minimal:10.0", + "remoteUser": "devcontainer", + "features": { + "common-utils": {} + } } } diff --git a/test/common-utils/ubi-10-minimal.sh b/test/common-utils/ubi-10-minimal.sh new file mode 100644 index 000000000..c84a61f2a --- /dev/null +++ b/test/common-utils/ubi-10-minimal.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +. /etc/os-release +check "non-root user" test "$(whoami)" = "devcontainer" +check "distro" test "${PLATFORM_ID}" = "platform:el10" +check "curl" curl --version +check "jq" jq --version +check "util-linux" unshare --version + +# Report result +reportResults