Executor deletes the context directory in multi-stage builds resulting in loss of command pathing #1572
Labels
area/multi-stage builds
issues related to kaniko multi-stage builds
categorized
differs-from-docker
issue/missing-files
priority/p1
Basic need feature compatibility with docker build. we should be working on this next.
work-around-available
works-with-docker
Actual behavior
The context directory is deleted when targeting a second stage of a multi-stage build when the second stage relies on a prior stage.
Expected behavior
The context directory should not be deleted.
To Reproduce
Steps to reproduce the behavior:
docker run -it --entrypoint sh gcr.io/kaniko-project/executor:debug-v1.3.0
Insert the following into the Dockerfile and save
Observe the following
The current working directory has been deleted.
Commands from the current working directory will not function
When running with the Gitlab Runner Operator for Openshift, this behavior causes a loss of command pathing and the ability to locate the busybox directory itself, even if you first change directories to root (outside the current context)
.gitlab-ci.yaml
gitlab build log (note the directory not found message appears in the log before the command that caused it)
With commands like
ls
andcp
no longer functioning due to the missing busybox directory, build artifacts cannot be copied back to the context directory path, which is where they must be located for Gitlab to be able to store them using its artifacts functionality.Additional Information
Nothing local required.
gcr.io/kaniko-project/executor@sha256:473d6dfb011c69f32192e668d86a47c0235791e7e857c870ad70c5e86ec07e8c
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: