Skip to content
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

chore: Merge some RUN steps in Dockerfile #33

Merged
merged 1 commit into from
Dec 4, 2024
Merged

Conversation

apljungquist
Copy link
Collaborator

@apljungquist apljungquist commented Dec 4, 2024

This reduces the size of the final image from 6G to 4.2G and the time it takes to build from step 10 it on my Debian 12 machine from 200s to 70s (On my ubuntu 22.04 machine the speedup is even bigger; I think there was some bug with Docker and that kernel that caused chmod to be even slower taking something like 5 minutes). The main improvement comes from not populating CARGO_HOME and RUSTUP_HOME, and chmod`ing them in separate steps since this caused the files to be included in two layers; the rust toolchain is particularly expensive at over 1G.

This reduces the size of the final image from 6G to 4.2G and the time
it takes to build it on my Debian 12 machine from 200s to 70s (On my
ubuntu 22.04 machine the speedup is even bigger; I think there was some
bug with Docker and that kernel that caused `chmod` to be even slower
taking something like 5 minutes). The main improvement comes from not
populating `CARGO_HOME` and `RUSTUP_HOME, and `chmod`ing them in
separate steps since this caused the files to be included in two
layers; the rust toolchain is particularly expensive at over 1G.
@apljungquist apljungquist requested a review from a team as a code owner December 4, 2024 09:56
@apljungquist apljungquist changed the title chore: Merge RUN steps in Dockerfile chore: Merge some RUN steps in Dockerfile Dec 4, 2024
@apljungquist apljungquist merged commit 1882342 into main Dec 4, 2024
1 check passed
@apljungquist apljungquist deleted the dockerfile branch December 4, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants