-
Notifications
You must be signed in to change notification settings - Fork 13k
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
CI: reduce docker image sizes #105176
CI: reduce docker image sizes #105176
Conversation
r? @jyn514 (rustbot has picked a reviewer for you, use r? to override) |
RUN apt-get update && \ | ||
apt-get install -y apt-transport-https software-properties-common && \ | ||
apt-transport-https software-properties-common && \ |
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.
This change forwards --no-install-recommends
for this packages too.
|
||
# Install dependencies for chromium browser | ||
RUN apt-get install -y \ |
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.
This change forwards --no-install-recommends
for this packages too.
Can you say more about what motivates the reduction in size here? It seems clear we can do better, but what use case is this impacting? In general the complexity of the Dockerfiles matters much more to me than saving a little bit of time on image downloads and such. |
Motivation is reducing size/traffic (slightly faster download, lower required disk space), given that added complexity of changes is trivial(cleaning apt/yum cache is non intrusive change used by many docker images). |
I disagree that this is trivial. When we update to a new version of apt/yum, this directory path can change, and the costs of thinking about this if we do it is still constantly there. If it was a global setting somewhere ("give me container optimized defaults"), then this would be relatively speaking more reasonable, but if we have to do it across each of our builders that adds a good bit of overhead to maintaining them. The savings of a few hundred megabytes at most are sort of nice, but they're also quite small - I don't think they justify having to think about this on every PR. Doing it as a one off isn't worth it either I think. |
For apt: location For yum: it's exactly option For pip: it's option too, no manual |
OK. Well, I'm not convinced this is a good idea, but we can let it hit CI and see if anything breaks as a result of trying to be cautious here. It'll bounce at least a few times while we rebuild caches in any case, I suspect. @bors r+ rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e1d8195): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
I noticed this seems to be adding a warning:
For example in https://github.com/rust-lang/rust/actions/runs/3625431239/jobs/6113472422 |
@ComputerDruid it's about inline comments like here rust/src/ci/docker/host-x86_64/x86_64-gnu-llvm-13/Dockerfile Lines 27 to 30 in c5351ad
Should be fixed long ago moby/moby#35004, but idk why it still here. |
I think it's actually complaining about the empty line above the comment, not the comment itself |
CI: reduce docker image sizes Reduces docker image sizes by using simple tips like: cleaning packet managers cache, squashing sequential installation steps into one. For some images this gives ~40mb for apt-based images (not so much), but ~200mb(!) for centos one.
Reduces docker image sizes by using simple tips like: cleaning packet managers cache, squashing sequential installation steps into one.
For some images this gives ~40mb for apt-based images (not so much), but ~200mb(!) for centos one.