-
Notifications
You must be signed in to change notification settings - Fork 174
feat(Dockerfile): modify base to use ubi-micro to reduce attack vectors #3432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: openshift/cluster-logging-operator
Length of output: 8104
🌐 Web query:
Red Hat UBI Micro does not include a package manager microdnf official documentation💡 Result:
It is correct that the Red Hat Universal Base Image (UBI) Micro does not include a package manager [1][2][3]. Red Hat explicitly excludes both microdnf and dnf, along with their dependencies, from the UBI Micro image to create the smallest possible image size and reduce the attack surface, a practice often referred to as "distroless" [1][2][3]. Because UBI Micro lacks a native package manager, software installation must be handled externally. Red Hat official documentation recommends the following methods for adding software to UBI Micro: 1. Build-time installation: Use tools like Buildah to mount the UBI Micro image from the host and install packages directly into the image's filesystem [4][2]. 2. DNF/Microdnf with --installroot: You can use dnf or microdnf on the host system (or within a container builder stage) to install packages into the UBI Micro root directory by specifying the --installroot option [2][5]. In contrast, the UBI Minimal image does include microdnf, which allows for package management directly inside the container [1][6][3].
Citations:
Do not run
microdnfin either UBI Micro runtime stage. UBI Micro excludesmicrodnf, so themicrodnf installcommand fails in both final stages. Install packages in a UBI Minimal or build stage, then copy them into UBI Micro, or use UBI Minimal as the runtime base.📍 Affects 2 files
Dockerfile#L20-L24(this comment)Dockerfile.art#L11-L15🤖 Prompt for AI Agents