Cache keys don't match for builds with a cached copy command #899
Labels
area/caching
For all bugs related to cache issues
kind/bug
Something isn't working
priority/p1
Basic need feature compatibility with docker build. we should be working on this next.
Actual behavior
When a build contains a cached layer using the
COPY
command all following layers in the build will produce incorrect cache keys. Specifically, the cache key used to read from the cache and the cache key used to write to the cache will be different for each layer following the copy command.Layers affected by this will never be able to read from the cache because the key used to write the layer to the cache is different than the key used to read from the cache.
The cause of this bug is due to CachingCopyCommand and CopyCommand returning different values for
FilesUsedFromContext
. The result ofFilesUsedFromContext
is added to the cache key.Expected behavior
All commands always produce the same cache key during read and during write given the same input.
To Reproduce
Steps to reproduce the behavior:
Additional Information
echo 'meow' > foo.txt
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: