Skip to content

feat(ubi-bash): add a UBI-based minimal shell image - #61

Open
krishnaGajabi wants to merge 3 commits into
openebs:developfrom
krishnaGajabi:feat/ubi-bash-image
Open

krishnaGajabi wants to merge 3 commits into
openebs:developfrom
krishnaGajabi:feat/ubi-bash-image

Conversation

@krishnaGajabi

@krishnaGajabi krishnaGajabi commented Nov 26, 2026 •

Copy link
Copy Markdown

Adds a third helper image, ubi-bash, built on registry.access.redhat.com/ubi9/ubi-micro:9.9, alongside the existing alpine-sh and alpine-bash.

Why

The helper and init containers in the OpenEBS charts run on Alpine today. Some deployments need those images to sit on a vendor-supported minimal base instead, and there is currently no option in this repo that offers one. This adds the option without changing anything about the existing three images.

What it ships

ubi-micro already provides bash and coreutils-single, which covers every command the helper and probe scripts use — timeout, sleep, date, chown. Nothing is installed on top, so the image carries no package manager. Result is ~23 MB.

netcat is deliberately absent. bash's /dev/tcp redirection does the same job for the readiness probes:

until timeout 5 bash -c "exec 3<>/dev/tcp/host/port"; do sleep 1; done

That keeps the image package-manager-free rather than pulling in a netcat and its dependency tree for one connect check.

There is also no FIPS configuration, by design. ubi-micro ships no crypto at all — no libcrypto, libssl, gnutls, nss or openssl binary — and the probes speak plain TCP, never TLS. Adding openssl-fips-provider would mean a crypto stack, and its CVE surface, for code nothing in the image calls. On a FIPS-enabled host the kernel is in FIPS mode regardless.

Platform list is now per-image

ubi-micro:9.9 publishes amd64, arm64, ppc64le and s390x — no linux/arm/v7, which the shared platform list in build.yml and release.yml requires. So the list moves into the matrix entry:

- image: alpine-bash
  platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le
- image: ubi-bash
  platforms: linux/amd64, linux/arm64, linux/ppc64le, linux/s390x

The three existing images keep exactly the list they had today.

Tests

ubi-micro ships no which, so the new make test assertions use command -v, and check that /dev/tcp correctly fails on a closed port rather than checking that nc exists.

Verified locally against the built image:

all tools present      # sh bash timeout sleep date chown
/dev/tcp works         # closed port correctly refused
/licenses/LICENSE      # present
23MB

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 <gajbikrishna23@gmail.com>
@krishnaGajabi

Copy link
Copy Markdown
Author

The chart-side change that consumes this image is up as a draft: openebs/mayastor-extensions#1143. It is blocked on a linux-utils release carrying ubi-bash.

@krishnaGajabi
krishnaGajabi marked this pull request as ready for review December 2, 2026 08:52
@krishnaGajabi
krishnaGajabi requested review from a team as code owners December 2, 2026 08:52
@krishnaGajabi
krishnaGajabi marked this pull request as draft December 2, 2026 08:58
…scriminate

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 <gajbikrishna23@gmail.com>
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 <gajbikrishna23@gmail.com>
@krishnaGajabi
krishnaGajabi marked this pull request as ready for review December 2, 2026 10:01

@niladrih niladrih left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants