chore: Merge some RUN
steps in Dockerfile
#33
Merged
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.
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 populatingCARGO_HOME
andRUSTUP_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.