Open zzh8829 opened 2 years ago
Thanks a lot for your investigation, it helped for me https://github.com/GoogleContainerTools/kaniko/issues/2049
@aaron-prindle
Is this officially considered a bug?
If this is fixed and the directory is no longer mounted, is there a way for us to allow kaniko to mount a specific directory?
Would that just be using volume mounts?
Actual behavior
Dockerfile content
Run this build command
Expected behavior I'd expect ls should have no output since we haven't copied any files into the docker build yet
from my investigation this bug happens when dockerfile uses WORKDIR to cd into the same directory as the local --context directory
this behaves as intended if we mount $(pwd) to /workspace2 or use
WORKDIR /workspace2
in dockerfileI think this is a pretty serious bug because I definitely didn't expect kaniko's context to be copied into docker build process at all and there was nothing in the doc that explained this behavior.
Triage Notes for the Maintainers
--cache
flag