Skip to content

Rebuild published UBI images nightly to pick up Iron Bank base fixes #3962

Description

@mcosgriff

Problem

Iron Bank republishes ubi9-minimal (and the traefik image we build on) under
the same mutable tag as Red Hat ships fixes. Our published *-ubi images are
built once at release time, so their CVE count only grows until the next
COSMOS release, even when a patched base is already available.

Proposal

A scheduled workflow (nightly, plus workflow_dispatch) that, for each
selected release:

  1. Checks out the release's git tag
  2. Rebuilds the 11 *-ubi images with --pull against the current Iron Bank base
  3. Scans the result with Trivy
  4. Pushes to Docker Hub and ghcr.io

Inputs (dispatch) / defaults (schedule):

  • versions: explicit list (6.10.0,6.9.2) or supported (latest patch of
    the last N minors, N configurable)
  • ubi_tag: override the base tag, default = the tag in that release's .env
  • force: rebuild even if the base digest is unchanged

Open questions / requirements

What to rebuild

  • Skip a release when its base digest (ubi9-minimal, traefik, QuestDB
    RHEL) is unchanged since the last rebuild; record the digest in an
    org.opencontainers.image.base.digest label and compare against it.
    Package updates inside the Dockerfiles can lower the CVE count even on an
    unchanged base, so force (or a periodic forced run) still has value
  • Older releases pin an older minor (e.g. OPENC3_UBI_TAG=9.6), which
    Iron Bank may no longer refresh. Decide whether to rebuild on the
    release's minor only, or allow bumping to the current minor (a base OS
    change on a published version)
  • Older tags carry older build scripts: use each tag's own
    build_multi_arch.sh, or main's script against the tag's sources

Tagging

  • Overwrite vX.Y.Z-ubi in place, and/or add an immutable
    vX.Y.Z-ubi-YYYYMMDD so users pinned to a rebuild can stay on it
  • Confirm Docker Hub and ghcr.io allow overwriting these tags (disable tag
    immutability if enabled)
  • Move latest only when the rebuilt version is the current latest
  • Confirm cleanup-ghcr.yml doesn't delete the superseded manifests that
    digest-pinned users still pull

Verification before push

  • Trivy must show no new CRITICAL/HIGH vs the currently published image;
    don't push a regression
  • Smoke test: containers start and the stack comes up healthy

After push

  • Regenerate the Trivy results and SBOMs attached to the GitHub release
    (post_release_trivy.yml)
  • Summarize per release: old vs new base digest, CVE delta, tags pushed

Operational

  • Iron Bank login currently uses a personal account's CLI token; move it
    to a service account before a scheduled job depends on it
  • concurrency group so it can't overlap a release run
  • Notify on failure (a stuck nightly means images silently go stale)

Enterprise

COSMOS Enterprise UBI images build on these core images, so they need the same
treatment:

  • Equivalent nightly rebuild in cosmos-enterprise, triggered after the core
    rebuild pushes (repository_dispatch or workflow_run), not on its own
    schedule, so it always builds on the fresh core images
  • Same version selection, tagging, Trivy gate and release-asset refresh
  • Enterprise-only images with their own external bases (e.g. Keycloak) get
    --pull too

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgithub_actionsPull requests that update GitHub Actions code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions