Migrate container base images from Debian to Red Hat UBI9#49
Migrate container base images from Debian to Red Hat UBI9#49yakovbeder wants to merge 2 commits into
Conversation
…imal. Align Dockerfiles and entrypoint with Red Hat UBI conventions (microdnf, uid 1001/default) for disconnected/enterprise environments. Co-authored-by: Cursor <cursoragent@cursor.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yakovbeder The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
WalkthroughThe container images now use UBI9 Node.js 22 minimal bases and ChangesUBI9 container migration
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Dockerfile`:
- Line 67: Update Dockerfile#L67-L67 to use a non-root default user and move
volume ownership handling to init/fsGroup or pre-provisioning; update
.ci-operator/build-root/Dockerfile#L3-L3, Dockerfile#L3-L3, and
Dockerfile#L42-L42 to switch back to the intended non-root user after privileged
setup while preserving workspace writability; update
Dockerfile.catalog-sync#L40-L40 so the emitted processor/data image is non-root
by default. Ensure all listed Dockerfiles never run as root by default.
- Around line 65-67: Add a real application readiness HEALTHCHECK to Dockerfile
at lines 65-67. Add the approved explicit disabled-healthcheck directive to
.ci-operator/build-root/Dockerfile at lines 1-6 and Dockerfile.catalog-sync at
lines 38-45, since those images are not run as services or only carry data.
In `@Dockerfile.catalog-sync`:
- Around line 38-45: Add a HEALTHCHECK to the processor image in
Dockerfile.catalog-sync, following the repository-approved policy: disable it
explicitly if this is a data-carrier image; otherwise define a meaningful check
that validates the processor’s health. Ensure the matching Dockerfile contains
an explicit HEALTHCHECK directive.
In `@entrypoint.sh`:
- Around line 15-20: Update the permission assignment in the entrypoint flow
around AUTHFILE to use mode 600 instead of 664, ensuring only the file owner can
read the pull secret; preserve the existing ownership change and file-existence
check.
- Line 4: Update the APP_USER initialization in the entrypoint to preserve an
externally supplied value while defaulting to “default”; derive the selected
user’s UID for host-permission fixes instead of hardcoding 1001. Validate that
APP_USER exists before invoking chown, su, or runuser, and retain the existing
flow for valid users.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: f7fb99ee-25df-4b0d-a510-5b27a5d19003
📒 Files selected for processing (4)
.ci-operator/build-root/DockerfileDockerfileDockerfile.catalog-syncentrypoint.sh
datetime.UTC requires Python 3.11+, but UBI9 ships Python 3.9, which broke catalog-sync CI when processing catalog metadata. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/retest |
|
@yakovbeder: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Fixes #38
Summary
node:22-slim(Debian) withregistry.access.redhat.com/ubi9/nodejs-22-minimalin all Dockerfilesapt-gettomicrodnfnode(uid 1000) to UBI'sdefault(uid 1001, gid 0)entrypoint.shto drop privileges asdefaultMotivation
Mirror-GUI runs on RHEL VMs in disconnected/air-gapped environments where Debian-based images are not acceptable. UBI9 matches the host OS family and provides FIPS-validated crypto when the host is in FIPS mode.
Changes
Dockerfileubi9/nodejs-22-minimal;microdnfinstalls; createdefaultuser (uid 1001)Dockerfile.catalog-syncprocessorstage →ubi9/nodejs-22-minimal; catalog index stages unchanged.ci-operator/build-root/Dockerfileubi9/nodejs-22-minimal;microdnf install gitentrypoint.shdefault(uid 1001) instead ofnode(uid 1000)Testing
./local-build.shsucceeds (catalog sync, UBI image build, container start)apt-getnot present, OS is RHEL 9.8)data/persistence verified with uid 1001 (default)Summary by CodeRabbit