-
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 hardcoded /bin/sh? #1129
Comments
Additional comments about this issue: This error appears to come from Line 97 in 7bf3f87
Further up in line 55 seems to be the culprit: Line 55 in 7bf3f87
It seems that /bin/sh -c is prepended to the command, as per the Dockerfile specification (https://docs.docker.com/engine/reference/builder/#run), which is fair enough. However note that the Dockerfile that contains the I tried to work around the issue by using the exec form,
Indeed, the busybox provided with the debug image does not provide ldconfig (I thought it would run in the context of the image, using the image's /sbin/ldconfig?):
It seems like something about Kaniko's implementation is making it behave different to Docker, but haven't read enough of the code to figure out how/why. |
Thanks @isantospardo Looks like something changed either the base image or the way we build the image right now. I am going to dig into this deeper and fix it before the next release |
@isantospardo I am not able to reproduce your issue with the following dockerfile
Here is the log.
|
@isantospardo Can you please verify? |
Here's a simplified Dockerfile that reproduces this issue. Works with Docker but doesn't with Kaniko:
Which yields:
However if you comment out that line that does
|
A possible workaround that also makes it work is to change the workdir back to a directory that exists, such as:
In my Dockerfile I was using this pattern of ADD something.tgz, WORKDIR /something, RUN ./configure && make install, RUN rm -rf /something, the rm -rf being to free up unnecessary data. Then I was using this as a base image in another Dockerfile which runs the ldconfig and triggers this bug (which works in Docker). Thankfully the issue can be simplified to be reproduced with a single Dockerfile. Thanks for looking into this! |
Hello, I have the same issue with kaniko 0.19.0
|
Thanks. Understood. |
I was not able to reproduce your use case @olivierboudet
It could also be because, the |
Ok, I tested again with kaniko 0.22.0, I reproduced it.
I will open an issue with gcrane but this dockerfile is fully building with docker deamon. |
I got a similar problem that @olivierboudet It can be reproduced also with I solved the problem by re-setting the PATH environment variable inside the dockerfile. |
最终解决方案是啥 啊 |
so, just write PATH in Dockerfile? but I'm failed.... |
Actual behavior
This is the Dockerfile for the debug image builder:
https://github.com/GoogleContainerTools/kaniko/blob/master/deploy/Dockerfile_debug
it seems like the shell is installed under /busyboxy, so it would be /busybox/sh? However images understandably assume it's in /bin/sh?
something in the build process is hardcoded to use /bin/sh?
I get the following error:
The text was updated successfully, but these errors were encountered: