kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

Volume directories do not get cleaned in the end of execution with --cleanup flag

Open jcsf opened this issue 3 years ago • 0 comments

Actual behavior When using the --cleanup flag it was expected that the full filesystem gets back to its initial state. But because it uses the ignored list updated during the build it will not delete the directories marked as volumes from the filesystem. This leads to errors when processing multiple images sequentially within the same kaniko image.

Expected behavior The filesystem of the kaniko image should delete everything that was created during the image build at the end of execution.

To Reproduce Steps to reproduce the behavior:

  1. Create 2 dockerfiles, a first one that instantiates a volume and a second one that tries to create a directory in the same path of the volume.
  2. Run kaniko sequentially on those two dockerfiles.

Additional Information

  • Dockerfile 1 image
  • Dockerfile 2 image
  • Build Context Attatched zip with dockerfiles and scripts to allow for easy reproducibility. Just run launch.sh
  • Kaniko Image (fully qualified with digest) gcr.io/kaniko-project/executor:v1.8.1-debug (e1e8f684a8d2)

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [ ]
Please check if the build works in docker but not in kaniko
  • - [x]
Please check if this error is seen when you use --cache flag
  • - [x]
Please check if your dockerfile is a multistage dockerfile
  • - [ ]

cleanup-issue.zip

jcsf avatar Jun 28 '22 16:06 jcsf