[release-4.21] OCPBUGS-76823: reduce MCO image size#5657
Conversation
In lieu of mounting package caches at build-time, we should clear them after package installation. Because the DNF wrapper sets the repo configuration differently in local vs. CI builds, this will only yield a ~44 MB reduction for local builds. However, it will yield a ~1.2 GB reduction for images built by CI.
Early versions of Buildah and/or OpenShift Image Builder presumably did not support path globbing for COPY directives, which required us to create a tarball and copy it into the final image. Although the tarball is deleted immediately after extraction, it still persists as an image layer when building an image locally due to the COPY directive. This unnecessary layer increases overall image size by ~480 MB. This is only the case for local image builds since OpenShift CI is configured to squash the final image layers, which makes this a non-issue for release images.
|
@openshift-cherrypick-robot: Jira Issue OCPBUGS-76450 has been cloned as Jira Issue OCPBUGS-76823. Will retitle bug to link to clone. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-76823, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@openshift-cherrypick-robot: The following test failed, say
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. |
|
/lgtm |
|
/label backport-risk-assessed /lgtm /retest-required |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: djoshy, openshift-cherrypick-robot, zaneb 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 |
|
/jira refresh |
|
@isabella-janssen: This pull request references Jira Issue OCPBUGS-76823, which is invalid:
Comment DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/verified later |
|
@pablintino: DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/verified later @pablintino |
|
/jira refresh |
|
@pablintino: This pull request references Jira Issue OCPBUGS-76823, which is valid. The bug has been moved to the POST state. 7 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@pablintino: This PR has been marked to be verified later by DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
fb967e8
into
openshift:release-4.21
|
@openshift-cherrypick-robot: Jira Issue OCPBUGS-76823: All pull requests linked via external trackers have merged: This pull request has the DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/cherrypick release-4.20 release-4.19 release-4.18 release-4.17 |
|
@isabella-janssen: new pull request created: #5673 DetailsIn response to this:
Instructions 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. |
|
Fix included in accepted release 4.21.0-0.nightly-2026-02-25-232937 |
This is an automated cherry-pick of #5644
/assign cheesesashimi