Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a --include-path flag to kaniko build #2884

Open
Ga13Ou opened this issue Nov 30, 2023 · 1 comment
Open

Adding a --include-path flag to kaniko build #2884

Ga13Ou opened this issue Nov 30, 2023 · 1 comment
Labels
area/cli bugs related to kaniko CLI area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) kind/feature-request priority/p2 High impact feature/bug. Will get a lot of users happy

Comments

@Ga13Ou
Copy link

Ga13Ou commented Nov 30, 2023

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 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 :

  1. Mount a pvc to the kaniko pod on a specific path
  2. Build the image
  3. 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
@aaron-prindle aaron-prindle added kind/feature-request priority/p2 High impact feature/bug. Will get a lot of users happy area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) area/cli bugs related to kaniko CLI labels Dec 4, 2023
@holmesb
Copy link

holmesb commented Sep 29, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli bugs related to kaniko CLI area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) kind/feature-request priority/p2 High impact feature/bug. Will get a lot of users happy
Projects
None yet
Development

No branches or pull requests

3 participants