Cleanup after Ubuntu apt and pip installs#111
Open
jgarver wants to merge 1 commit intotianocore:mainfrom
Open
Conversation
1de527d to
e07604f
Compare
For each apt install, we should update, install and clean all in the same RUN. This avoids carrying around apt temporary files in intermediate layers. Also, during pip installs, do not cache temporary files. This change reduced the Ubuntu-22 image size by approximately 0.5GB.
e07604f to
e4e036f
Compare
Contributor
|
Maybe Use cache mounts. RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && apt-get --no-install-recommends install -y gccRUN --mount=type=cache,target=/root/.cache/pip \
pip install -r requirements.txt |
Contributor
Author
|
I like that. Let me try it. Thanks! |
Contributor
|
The Fedora 41 image uses cache mounts. Any intention to update this PR or can it be closed? |
Contributor
Author
|
@osteffenrh I plan to update it, but it's not a priority right now. I need to migrate us to Ubuntu24, so I'll definitely be revisiting this. My guess is it'll be in the August time frame. If you want to close it, I'll re-open it when I get back to it. |
Contributor
|
@jgarver, no rush. Let's leave this open then. Thanks! |
Merged
Contributor
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
For each apt install, we should update, install and clean all in the same RUN. This avoids carrying around apt temporary files in intermediate layers.
Also, during pip installs, do not cache temporary files.
Containers Affected
Ubuntu-22
Ubuntu-24