-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Kaniko recursion error while building docker image #2210
Comments
It seems that cleanup removes all directory except those in |
I think what I attempted to do is simply impossible with Kaniko because it contains itself a kaniko folder. |
Also getting this issue |
@orangeswim There's no way around it from what I understand. Kaniko is designed this way to avoid using special capabilities by forcing the use of Then Kaniko execute the docker file on its own file system and after each steps it makes a snapshot of the changes made to the filesystem. As a result any change made into the What this means is that you can't build kaniko with kaniko unless both the image running kaniko and the image you're building agrees on a folder to not touch.. I guess what can be done is to build a Kaniko image with docker to store/lookup files in But it's simpler to just not use |
So there's really no way to build any image containing kaniko with kaniko because the |
Has anybody figured out an easy way to work around this? Kinda stupid it can't build itself... |
@ryandiamond23 haven't tried it, but you might be able to build kaniko to have its path in something else than /kaniko. Then you use that new kaniko to build it again but this time in /kaniko |
Related #1881 |
Fixed with #2863, closing |
Actual behavior
It cannot build an image with multi-stage from kaniko itself.
Expected behavior
It should just build
To Reproduce
Additional Information
Dockerfile:
That said, this docker image does work:
But in order to make it work, you have to create the /kaniko directory yourself first before every build
Then you have to set the KANIKO_DIR environment variable to something different than /kaniko. The --kaniko-dir shouldn't be defined or it should be set to the same thing as KANIKO_DIR. Which is rather strange... When the command starts, it attempt to use /kaniko regardless... that's why you have to create the directory first as when kaniko-dir is defined it will not attempt to create the folder... Then when it's done, it destroys the /kaniko directory but the one defined in --kaniko-dir AND KANIKO_DIR remains.
When using --cleanup it deletes the /bin directory as seen here and /kan (KANIKO_DIR) is not empty.
You can see here that if the kaniko path is different to /kaniko it will remove it. Which doesn't really make any sense. What this means is that the binaries in /kaniko gets moved to the new kaniko dir and Kaniko gets destroyed at the end. Since the default KanikoDir isn't there it will not be able to copy it initially.
kaniko/cmd/executor/cmd/root.go
Lines 255 to 262 in 348018d
The text was updated successfully, but these errors were encountered: