.dockerignore not considered when computing cache keys #871
Labels
area/caching
For all bugs related to cache issues
in progress
kind/bug
Something isn't working
priority/p2
High impact feature/bug. Will get a lot of users happy
Milestone
Actual behavior
Files excluded by
.dockerignore
are wrongly included when determining whether the cache can be used for aCOPY
build step.Expected behavior
Modifications to files excluded by
.dockerignore
do not affect the cacheability ofCOPY
steps.To Reproduce
Project files
example/project/.dockerignore
example/project/Dockerfile
example/project/files/a.txt
example/project/files/b.txt
example/docker_config.json
example/docker-compose.yml [*]
[*] I would have used
docker run ...
instead ofdocker-compose
except I couldn't figure out the Windows-compatible syntax thatdocker run
wanted for mounting volumes.Command line instructions
I do not include the full output of each command. Instead I include my own comments about the output
### formatted like this
.Additional Information
My theory for the issue's cause
While
copy.go
'sExecuteCommand
takes exclusions from.dockerignore
into account, theFilesUsedFromContext
function from that same file does not consider exclusions, and that second function is what's used to compute cache keys. EitherFilesUsedFromContext
or its caller inbuild.go
should be changed to be aware of.dockerignore
.Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: