switching to hardened images to reduce image size and CVE footprint#133
switching to hardened images to reduce image size and CVE footprint#133acornett21 wants to merge 1 commit into
Conversation
Signed-off-by: Adam D. Cornett <adc@redhat.com>
WalkthroughThe Dockerfile replaces both stage base images with internal Red Hat registry images: the builder stage moves from ChangesDockerfile Base Image Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 6: Verify the builder image specified in the FROM statement
(registry.access.redhat.com/hi/go:1.26-builder) includes the make utility
required by the build command, and if not available, add it via a RUN
instruction. Additionally, replace the `:latest` tag on the runtime image
(registry.access.redhat.com/hi/core-runtime:latest) with a specific version
number to ensure reproducible builds and prevent unintended updates when the
image is rebuilt.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: e5335888-52e5-4466-ac78-6e4b635a8fa4
📒 Files selected for processing (1)
Dockerfile
| ARG OS=linux | ||
|
|
||
| FROM docker.io/golang:1.26 AS builder | ||
| FROM registry.access.redhat.com/hi/go:1.26-builder AS builder |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the new builder image is accessible and has required tools
# Note: This assumes you have credentials configured for registry.access.redhat.com
# Try to inspect the image (requires authentication)
podman inspect registry.access.redhat.com/hi/go:1.26-builder 2>&1 | head -20
# Try to pull and inspect Go version (if accessible)
podman pull registry.access.redhat.com/hi/go:1.26-builder 2>&1 && \
podman run --rm registry.access.redhat.com/hi/go:1.26-builder go version
# Check if make is available
podman run --rm registry.access.redhat.com/hi/go:1.26-builder which makeRepository: redhat-openshift-ecosystem/preflight-trigger
Length of output: 244
Verify builder image includes make and pin runtime image version for reproducibility.
The switch to Red Hat hardened images from the public registry.access.redhat.com registry is supported—the registry is publicly accessible and requires no authentication. The -builder variant image includes development tools for compilation.
Two minor items to verify:
- Confirm the
makeutility is available in theregistry.access.redhat.com/hi/go:1.26-builderimage, as the build command on line 15 requires it. - Pin the runtime image on line 18 from
registry.access.redhat.com/hi/core-runtime:latestto a specific version tag for reproducible builds and to avoid unexpected updates.
🤖 Prompt for 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.
In `@Dockerfile` at line 6, Verify the builder image specified in the FROM
statement (registry.access.redhat.com/hi/go:1.26-builder) includes the make
utility required by the build command, and if not available, add it via a RUN
instruction. Additionally, replace the `:latest` tag on the runtime image
(registry.access.redhat.com/hi/core-runtime:latest) with a specific version
number to ensure reproducible builds and prevent unintended updates when the
image is rebuilt.
|
It looks like the base id has changed, so we can not write files. |
Summary by CodeRabbit