I'm encountering a challenge with persistent volume usage in Kaniko.
To manage ephemeral storage issues in Kaniko pods, I've set up a PVC/PV and mounted it at /opt/my-user/my-big-dependencies-and-relevant-files for building the image. With the build process utilizing the persistent volume effectively, thereby reducing the load on node ephemeral storage.
However, I encountered an issue where the contents of /opt/my-user/my-big-dependencies-and-relevant-files are not included in the final image that is pushed to the registry. This results in the final image missing installed packages that were expected to be part of it.
Upon investigating, I found that the internal logic of Kaniko, specifically in fs_util.go (fs_util.go#L455C6-L455C32), seems to skip directories listed in /proc/self/mountinfo during the snapshotting process. The logs indicate that /opt/my-user/my-big-dependencies-and-relevant-files is recognized as mounted but is later 'whiteouted' and skipped in the final image.
While Kaniko offers an --ignore-paths flag, it lacks an equivalent include-paths option.
Expected behavior
Have the mounted paths be part of the image. Or have flag that can be used to explicitly include those paths
To Reproduce
Steps to reproduce the behavior in kubernetes :
Mount a pvc to the kaniko pod on a specific path
Build the image
Note that the specific mounted path is ignored during build and does not exist in the final image.
Thank you in advance for your assistance and looking forward to a possible enhancement in Kaniko's functionality.
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
- [ ]
Please check if this error is seen when you use --cache flag
- [ ]
Please check if your dockerfile is a multistage dockerfile
A new --include-path flag would fix the issue reported by CloudBees. This prevents Kaniko builds working on Jenkins that touch the Jenkins home dir (/home/jenkins).
Actual behavior Hello Kaniko Team,
I'm encountering a challenge with persistent volume usage in Kaniko. To manage ephemeral storage issues in Kaniko pods, I've set up a PVC/PV and mounted it at
/opt/my-user/my-big-dependencies-and-relevant-files
for building the image. With the build process utilizing the persistent volume effectively, thereby reducing the load on node ephemeral storage.However, I encountered an issue where the contents of
/opt/my-user/my-big-dependencies-and-relevant-files
are not included in the final image that is pushed to the registry. This results in the final image missing installed packages that were expected to be part of it.Upon investigating, I found that the internal logic of Kaniko, specifically in fs_util.go (fs_util.go#L455C6-L455C32), seems to skip directories listed in
/proc/self/mountinfo
during the snapshotting process. The logs indicate that/opt/my-user/my-big-dependencies-and-relevant-files
is recognized as mounted but is later 'whiteouted' and skipped in the final image.While Kaniko offers an
--ignore-paths
flag, it lacks an equivalentinclude-paths
option.Expected behavior Have the mounted paths be part of the image. Or have flag that can be used to explicitly include those paths
To Reproduce Steps to reproduce the behavior in kubernetes :
Note that the specific mounted path is ignored during build and does not exist in the final image.
Thank you in advance for your assistance and looking forward to a possible enhancement in Kaniko's functionality.
Triage Notes for the Maintainers
--cache
flag