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
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -107,10 +113,11 @@ 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: |
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 }}
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- image: linux-utils
- image: alpine-sh
- image: alpine-bash
- image: ubi-bash
steps:
- name: Checkout
uses: actions/checkout@v7
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/trivy-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- image: linux-utils
- image: alpine-sh
- image: alpine-bash
- image: ubi-bash
steps:
- name: Checkout
uses: actions/checkout@v7
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -84,6 +84,17 @@ 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.
@# 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>&1 | grep -q 'Connection refused'
@echo "/dev/tcp works"

.PHONY: clobber
clobber:
Expand Down
65 changes: 65 additions & 0 deletions dockerfiles/ubi-bash/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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.
#
# 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"
ARG DBUILD_SITE_URL="https://www.openebs.io/"
ARG RELEASE_TAG

COPY LICENSE /licenses/LICENSE

# 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." \
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"
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