Repository navigation
Conversation
The build cache depends on the permissions of the files of the build context: a checkout made with a 002 umask (the default one of many Linux distributions) gets 664 files instead of the 644 ones of the CI, and never reuses the registry cache it pushes. The very first COPY of php-base misses, then every following step is rebuilt. COPY --chmod does not help: the cache key is computed on the source files, before the chmod. "castor docker:build" and "castor docker:push" now give the files tracked by git their git permissions (644 or 755, and 755 for their directories) before building. Untracked files (e.g. the certificates private key) are left untouched.
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.
Refs #430
The build cache depends on the permissions of the files of the build context. A checkout made with a
002umask (the default one of many Linux distributions) gets664files and775directories, instead of the644/755ones of the CI checkout. So it never reuses the registry cache pushed by the CI: theCOPY php/mods-available/ofphp-basemisses, then every following step is rebuilt.castor docker:buildandcastor docker:pushnow give the files tracked by git their git permissions (644or755, and755for their directories) before building. Untracked files (e.g. the private key of the local certificates) are left untouched, and so are the additional build contexts (the application of the production images).COPY --chmoddoesn't help: the cache key is computed on the source files, before the chmod.Tests
Local builds of
frontendandbuilderwith a fresh buildx builder (no local cache), importing the registry caches of docker-starter:022(like the CI)002, before this PRphp-base4/6, 6 runs out of 6002,COPY --chmod=u=rwX,go=rX002, with this PRThe private key of the certificates (
600, untracked) keeps its permissions.