Skip to content

Conversation

@mzihlmann
Copy link
Collaborator

@mzihlmann mzihlmann commented Jan 11, 2026

Fixes #444

Description

So far we assumed that we always start off with executor in /kaniko/executor. The KANIKO_DIR env variable is not used to tell kaniko where it is located, but instead is used to dynamically relocate the kaniko binary after start. When we start off with kaniko in a different directory, we can't even start building. If we were to set the KANIKO_DIR, we would try to copy a non-existing binary over, if we don't set it, all subpaths are now broken. With this change we no longer assume the binary to be in /kaniko/executor, instead we just use the path of the executable being invoked directly. So in the images we provide it will always be /kaniko/executor but it will work transparently for users that copy the binary somewhere else. All subdirectories are automatically adjusted.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

Describe any changes here so maintainer can include it in the release notes, or delete this block.

Examples of user facing changes:
- kaniko adds a new flag `--registry-repo` to override registry

@mzihlmann mzihlmann changed the title mz440: dynamically determine kanikoDir mz444: dynamically determine kanikoDir Jan 11, 2026
@mzihlmann mzihlmann marked this pull request as ready for review January 11, 2026 17:07
@mzihlmann mzihlmann requested review from 0hlov3, BobDu, babs and nejch January 11, 2026 17:07
@mzihlmann
Copy link
Collaborator Author

hmmmm... we should add some integration test for this. I do have an e2e test here https://gitlab.com/martizih/kaniko-custom-image/-/merge_requests/1 but it would be nice to integrate and automate it here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make caches directory configurable

2 participants