[DX-3383] Fix Docker caching#1485
Closed
kalverra wants to merge 2 commits into
Closed
Conversation
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.
.github/actions/build-push-docker/action.yml -- 3 changes
Bug fix
Output names cache-from and cache-to (lines 308, 314) were renamed to docker-cache-from and docker-cache-to to match the references on lines 340-341. This fixes Docker layer caching that was silently broken -- cache-from and cache-to were always resolving to empty strings because the output names didn't match the references.
New input
docker-build-cache-scope (lines 48-54) -- optional, defaults to empty. When provided, overrides runner.arch as the cache scope. This lets callers separate caches for different Dockerfiles building on the same architecture.
Scope wiring (lines 297-303): The format() call now uses inputs.docker-build-cache-scope || runner.arch instead of just runner.arch.
github/actions/ctf-build-image/action.yml -- 2 changes
New input
cache-scope (lines 111-117) -- passed through to build-push-docker as docker-build-cache-scope.
Always restore cache (line 193): Changed docker-restore-cache from ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }} to "true". Push builds (develop merges) will now benefit from cached layers instead of rebuilding from scratch.
Results