-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
docker: enable more caching #10974
Merged
Merged
docker: enable more caching #10974
Conversation
This file contains 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
rouault
reviewed
Oct 9, 2024
pjonsson
force-pushed
the
docker-more-cache
branch
from
October 9, 2024 16:03
797bd6c
to
be4b837
Compare
shellcheck is complaining:
|
Add --docker-cache/--no-docker-cache parameters to the script, and default to --no-docker-cache when building releases. Having the on/off option defaults to the safe choice, but when explicitly passed, it's possible to do local experimentation with building the release image and benefitting from the cache.
Use a colon like the other lines.
pjonsson
force-pushed
the
docker-more-cache
branch
from
October 9, 2024 21:06
be4b837
to
9133427
Compare
The BUILD_ARGS array is mostly the same for both branches, so hoist the definition and append the unique parts inside each branch.
Enable building without the rsync daemon. This is preparation for being able to use ccache and Docker caching without syncing with the home directory. As a bonus, no rsync daemon means the build can use the default network instead of host, so more encapsulation.
Permit building images with ccache and caching inside Docker, but without syncing the cache to the home directory.
Hoist the installation of ccache and rsync into one of the early blocks in all images. This ensures that the ccache binary is available for everything built.
Use the docker cache for package lists and deb files. This avoids updating the same lists multiple times in the same build, and enables consecutive builds to install packages without downloading them from internet.
pjonsson
force-pushed
the
docker-more-cache
branch
from
October 9, 2024 21:31
9133427
to
7f11471
Compare
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.
This changes a lot of things all over the place, but the big picture is:
--no-cache
to Docker so they don't accidentally pick up something from the Docker cache. For local experimentation, that can be overridden by passing--docker-cache
to build.sh.sharing=locked
. To avoid blocking concurrent docker image builds, apt-get calls were put in a separateRUN
statement from a long-running compilation.It's always tempting to change everything at once, but I have tried to restrain myself so this PR would still be reviewable. Each commit does one thing, and viewing the commit without showing whitespace changes should give a reasonably sized change.
I have built all images locally with both
--release
and without it.