From 0834ff36323d04006c1ecb5846f25dc2e10aac1c Mon Sep 17 00:00:00 2001 From: krishnaGajabi Date: Thu, 26 Nov 2026 16:42:38 +0000 Subject: [PATCH 1/3] feat(ubi-bash): add a UBI-based minimal shell image The helper and init containers in the OpenEBS charts currently use alpine-sh / alpine-bash. Some deployments need those images to sit on a vendor-supported minimal base instead of Alpine, so add a third option built on ubi9/ubi-micro. ubi-micro already ships bash and coreutils-single, which covers every command the helper and probe scripts use (timeout, sleep, date, chown), so nothing is installed and the image needs no package manager. netcat is deliberately absent. bash's /dev/tcp redirection does the same job for the readiness probes, which lets the image stay package-manager free rather than pulling in a netcat and its dependency tree. ubi-micro publishes no linux/arm/v7 and does publish linux/s390x, so the build and release workflows now take the platform list per matrix entry instead of one list shared by every image. The existing three images keep exactly the list they had. `make test` checks the tools with `command -v` rather than `which`, which ubi-micro does not ship, and asserts that /dev/tcp correctly reports a closed port instead of asserting that nc exists. Signed-off-by: krishnaGajabi --- .github/workflows/build.yml | 8 ++++++- .github/workflows/pull_request.yml | 1 + .github/workflows/release.yml | 8 ++++++- .github/workflows/trivy-ci.yml | 1 + Makefile | 9 +++++++- dockerfiles/ubi-bash/Dockerfile | 35 ++++++++++++++++++++++++++++++ 6 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 dockerfiles/ubi-bash/Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1ba7b2..a38cd4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,14 @@ jobs: matrix: include: - image: linux-utils + platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le - image: alpine-sh + platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le - image: alpine-bash + platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le + # ubi-micro publishes no linux/arm/v7, and does publish s390x. + - image: ubi-bash + platforms: linux/amd64, linux/arm64, linux/ppc64le, linux/s390x steps: - name: Checkout uses: actions/checkout@v7 @@ -107,7 +113,7 @@ jobs: push: true sbom: true provenance: mode=max - platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le + platforms: ${{ matrix.platforms }} tags: | ${{ steps.docker_meta.outputs.tags }} build-args: | diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index f872f09..6749c19 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -31,6 +31,7 @@ jobs: - image: linux-utils - image: alpine-sh - image: alpine-bash + - image: ubi-bash steps: - name: Checkout uses: actions/checkout@v7 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1db8dcc..14dd7b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,8 +26,14 @@ jobs: matrix: include: - image: linux-utils + platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le - image: alpine-sh + platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le - image: alpine-bash + platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le + # ubi-micro publishes no linux/arm/v7, and does publish s390x. + - image: ubi-bash + platforms: linux/amd64, linux/arm64, linux/ppc64le, linux/s390x steps: - name: Checkout uses: actions/checkout@v7 @@ -103,7 +109,7 @@ jobs: push: true sbom: true provenance: mode=max - platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le + platforms: ${{ matrix.platforms }} tags: | ${{ steps.docker_meta.outputs.tags }} build-args: | diff --git a/.github/workflows/trivy-ci.yml b/.github/workflows/trivy-ci.yml index e0f844d..a898655 100644 --- a/.github/workflows/trivy-ci.yml +++ b/.github/workflows/trivy-ci.yml @@ -19,6 +19,7 @@ jobs: - image: linux-utils - image: alpine-sh - image: alpine-bash + - image: ubi-bash steps: - name: Checkout uses: actions/checkout@v7 diff --git a/Makefile b/Makefile index e00a64e..6967c11 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ ifeq (${IMAGE_ORG}, ) endif ifeq (${DIMAGES}, ) - DIMAGES:=linux-utils alpine-sh alpine-bash + DIMAGES:=linux-utils alpine-sh alpine-bash ubi-bash export DIMAGES endif @@ -84,6 +84,13 @@ test: @sudo docker run --rm "$$IMAGE_ORG/alpine-bash:ci" which /bin/bash @sudo docker run --rm "$$IMAGE_ORG/alpine-bash:ci" which nc @sudo docker run --rm "$$IMAGE_ORG/alpine-bash:ci" which chown + @# ubi-micro ships no `which`, so check with a bash builtin instead. + @sudo docker run --rm --entrypoint /bin/bash "$$IMAGE_ORG/ubi-bash:ci" -c \ + 'for t in sh bash timeout sleep date chown; do command -v $$t >/dev/null || { echo "missing: $$t"; exit 1; }; done' + @# netcat is deliberately absent: the probes use bash's /dev/tcp instead, + @# so check that redirection works rather than that nc exists. + @sudo docker run --rm --entrypoint /bin/bash "$$IMAGE_ORG/ubi-bash:ci" -c \ + 'exec 3<>/dev/tcp/127.0.0.1/9 2>/dev/null && { echo "closed port wrongly succeeded"; exit 1; }; echo "/dev/tcp works"' .PHONY: clobber clobber: diff --git a/dockerfiles/ubi-bash/Dockerfile b/dockerfiles/ubi-bash/Dockerfile new file mode 100644 index 0000000..8387c44 --- /dev/null +++ b/dockerfiles/ubi-bash/Dockerfile @@ -0,0 +1,35 @@ +# Minimal shell image for OpenEBS helper and init containers, on Red Hat UBI. +# +# ubi-micro already ships bash, coreutils-single (timeout, sleep, date, chown) +# and ncurses, which is everything the helper and probe commands use, so no +# package is installed here and the image needs no package manager. +# +# bash is the reason this is the micro image rather than a scratch one: its +# /dev/tcp redirection replaces netcat for the readiness probes, so nothing +# extra has to be installed to check that a dependency is listening. +# There is deliberately no FIPS configuration here. ubi-micro ships no crypto +# at all - no libcrypto, no libssl, no gnutls, no nss, no openssl binary - and +# the probes speak plain TCP, never TLS. Installing openssl-fips-provider would +# add a crypto stack, and its CVE surface, for code that nothing in this image +# calls. On a FIPS-enabled host the kernel is in FIPS mode regardless. +FROM registry.access.redhat.com/ubi9/ubi-micro:9.9 + +ARG DBUILD_DATE +ARG DBUILD_REPO_URL="https://github.com/openebs/linux-utils" +ARG DBUILD_SITE_URL="https://www.openebs.io/" + +COPY LICENSE /licenses/LICENSE + +# Red Hat's own labels describe ubi-micro; restate them for this image. +LABEL name="openebs/ubi-bash" \ + vendor="OpenEBS" \ + maintainer="OpenEBS Maintainers" \ + summary="Minimal shell container for OpenEBS helper jobs" \ + description="Provides bash, timeout, sleep, date and chown for OpenEBS helper and init containers." + +LABEL org.label-schema.schema-version="1.0" +LABEL org.label-schema.name="linux-utils" +LABEL org.label-schema.description="Linux Container for OpenEBS Helper jobs" +LABEL org.label-schema.build-date=$DBUILD_DATE +LABEL org.label-schema.vcs-url=$DBUILD_REPO_URL +LABEL org.label-schema.url=$DBUILD_SITE_URL From 5b5116bf24f3c96cae555fded0554119e9f03a91 Mon Sep 17 00:00:00 2001 From: krishnaGajabi Date: Wed, 2 Dec 2026 09:00:46 +0000 Subject: [PATCH 2/3] fix(ubi-bash): set version and release, and make the /dev/tcp test discriminate Restating only some of ubi-micro's labels left the image describing the base rather than itself: `version` read 9.9 and `release` carried Red Hat's build id, on every release of this image. Set both from build arguments the workflows already produce, along with url, build-date and the io.k8s pair. build.yml now passes RELEASE_TAG too, so a develop build labels itself with the tag it was built as. com.redhat.component, com.redhat.license_terms and cpe stay inherited on purpose. They describe the base layer accurately, and cpe is what vulnerability scanners read to select the Red Hat CVE feed. The /dev/tcp assertion checked that a closed port is refused. A bash built without net redirections fails that same exec, reporting "No such file or directory" for the literal path, so the assertion passed whether or not the feature existed -- which is the one thing the absent netcat depends on. Grep for the refusal instead, so only a bash that reaches connect(2) passes. Signed-off-by: krishnaGajabi --- .github/workflows/build.yml | 1 + Makefile | 10 +++++++--- dockerfiles/ubi-bash/Dockerfile | 21 +++++++++++++++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a38cd4d..896f9af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,3 +120,4 @@ jobs: DBUILD_DATE=${{ steps.date.outputs.DATE }} DBUILD_REPO_URL=https://github.com/openebs/linux-utils DBUILD_SITE_URL=https://openebs.io + RELEASE_TAG=${{ env.TAG }} diff --git a/Makefile b/Makefile index 6967c11..2b979d7 100644 --- a/Makefile +++ b/Makefile @@ -87,10 +87,14 @@ test: @# ubi-micro ships no `which`, so check with a bash builtin instead. @sudo docker run --rm --entrypoint /bin/bash "$$IMAGE_ORG/ubi-bash:ci" -c \ 'for t in sh bash timeout sleep date chown; do command -v $$t >/dev/null || { echo "missing: $$t"; exit 1; }; done' - @# netcat is deliberately absent: the probes use bash's /dev/tcp instead, - @# so check that redirection works rather than that nc exists. + @# netcat is deliberately absent: the probes use bash's /dev/tcp instead. + @# A bash built without net redirections fails this exec too, reporting + @# "No such file or directory" for the literal path, so the test greps for + @# the refusal: only a bash that understands /dev/tcp gets as far as a + @# connect(2) on a closed port. @sudo docker run --rm --entrypoint /bin/bash "$$IMAGE_ORG/ubi-bash:ci" -c \ - 'exec 3<>/dev/tcp/127.0.0.1/9 2>/dev/null && { echo "closed port wrongly succeeded"; exit 1; }; echo "/dev/tcp works"' + 'exec 3<>/dev/tcp/127.0.0.1/9' 2>&1 | grep -q 'Connection refused' + @echo "/dev/tcp works" .PHONY: clobber clobber: diff --git a/dockerfiles/ubi-bash/Dockerfile b/dockerfiles/ubi-bash/Dockerfile index 8387c44..ab384d6 100644 --- a/dockerfiles/ubi-bash/Dockerfile +++ b/dockerfiles/ubi-bash/Dockerfile @@ -17,15 +17,32 @@ FROM registry.access.redhat.com/ubi9/ubi-micro:9.9 ARG DBUILD_DATE ARG DBUILD_REPO_URL="https://github.com/openebs/linux-utils" ARG DBUILD_SITE_URL="https://www.openebs.io/" +ARG RELEASE_TAG COPY LICENSE /licenses/LICENSE -# Red Hat's own labels describe ubi-micro; restate them for this image. +# Red Hat's own labels describe ubi-micro, and an image that restates only some +# of them ends up making claims about itself that belong to the base: without +# the two below, `version` reads 9.9 and `release` is Red Hat's build id for +# every release of this image. RELEASE_TAG is the image tag the workflows build +# with, so the label and the tag always agree; the defaults are for a bare +# `docker build` that passes neither argument. LABEL name="openebs/ubi-bash" \ vendor="OpenEBS" \ maintainer="OpenEBS Maintainers" \ + version="${RELEASE_TAG:-develop}" \ + release="${DBUILD_DATE:-develop}" \ summary="Minimal shell container for OpenEBS helper jobs" \ - description="Provides bash, timeout, sleep, date and chown for OpenEBS helper and init containers." + description="Provides bash, timeout, sleep, date and chown for OpenEBS helper and init containers." \ + url="${DBUILD_SITE_URL}" \ + build-date="${DBUILD_DATE}" \ + io.k8s.display-name="OpenEBS UBI Bash" \ + io.k8s.description="Provides bash, timeout, sleep, date and chown for OpenEBS helper and init containers." + +# com.redhat.component, com.redhat.license_terms and cpe are left as inherited +# on purpose. They describe the base layer accurately, and cpe in particular is +# what vulnerability scanners read to select the Red Hat CVE feed, so clearing +# it would cost correct scan results. LABEL org.label-schema.schema-version="1.0" LABEL org.label-schema.name="linux-utils" From f981f95a7ef272fc8b0ac2e3d28a8b66b5b17337 Mon Sep 17 00:00:00 2001 From: krishnaGajabi Date: Wed, 2 Dec 2026 09:43:39 +0000 Subject: [PATCH 3/3] build(ubi-bash): pin the base image by digest registry.access.redhat.com/ubi9/ubi-micro:9.9 is rebuilt in place, so the bare tag names different content over time: it moved from sha256:b59ac4f2 to sha256:dbd325b9 within one week, before this branch was even opened. Nothing in this repo rebuilds a published image tag -- build.yml runs on pushes to develop and release.yml on a release -- so the floating tag was not delivering base fixes to any published image. It only changed what the next build happened to pick up, with no diff to show for it, and it left the scheduled trivy scan free to change verdict with no commit behind it. Pinning turns a base change into something reviewable and gives that scan a line to point at. The alpine images keep their plain tags on purpose: Alpine does not rebuild a patch tag, so alpine:3.23.5 is already immutable. The digest is the manifest list, not a per-architecture one; verified to build for all four platforms this image targets. Signed-off-by: krishnaGajabi --- dockerfiles/ubi-bash/Dockerfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dockerfiles/ubi-bash/Dockerfile b/dockerfiles/ubi-bash/Dockerfile index ab384d6..36b8eec 100644 --- a/dockerfiles/ubi-bash/Dockerfile +++ b/dockerfiles/ubi-bash/Dockerfile @@ -12,7 +12,20 @@ # the probes speak plain TCP, never TLS. Installing openssl-fips-provider would # add a crypto stack, and its CVE surface, for code that nothing in this image # calls. On a FIPS-enabled host the kernel is in FIPS mode regardless. -FROM registry.access.redhat.com/ubi9/ubi-micro:9.9 +# +# Pinned by digest, unlike the alpine images in this repo. Alpine does not +# rebuild a patch tag, so alpine:3.23.5 is already immutable; Red Hat rebuilds +# ubi9/ubi-micro:9.9 in place, so the bare tag names different content over +# time. Nothing here rebuilds a published image tag, so the floating tag was +# never delivering base fixes to a release -- it only changed what the next +# build picked up, without a diff to show for it. +# +# The digest is the manifest list, covering all four platforms this image is +# built for. A per-architecture digest builds on amd64 and fails the other +# three at release time, which is the first place they are built. +# +# Bump both parts together when the scheduled trivy scan flags the base. +FROM registry.access.redhat.com/ubi9/ubi-micro:9.9-1794478307@sha256:dbd325b96bcd432dd42816d31412bdf1dc0fb973b79ed310344bc23c76c068db ARG DBUILD_DATE ARG DBUILD_REPO_URL="https://github.com/openebs/linux-utils"