-
Notifications
You must be signed in to change notification settings - Fork 773
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
exec user process caused "exec format error" when run container with CMD on RHEL #475
Comments
@gouyang Thanks for the issue report, we'll take a look at it. |
@gouyang Could you try to build buildah from master and see if you get this issue. I just built buildah-0.15 for RHEL, but it will take a few weeks to get released. |
The issue is still existing by building buildah from master.
|
THis could be a runc version error. |
It's the same result with runc build from master.
|
I finally had some time to play and wasn't able to duplicate this. I tried both Buildah 0.12 and Buildah 0.15 and everything worked for me. Our runc versions are different, I just used what ever was installed with RHEL rather than updating that.
I then upgraded runc to the latest version and had the same result:
If possible, could you retest on a new VM with RHEL @gouyang ? |
It's not reproduced on a new VM RHEL guest. It's strange it 's always reproduced on one of my RHEL system no matter reboot the system or reinstall buildah+runc on it. |
It seems the problem of the
|
@gouyang thanks for the follow up. That's strange that the binary was problematic on just that one machine. If you run into that again, please reopen or open a new issue. |
@gouyang Make sure if there is a shebang in Though I'm not familiar with go, I happen to find here since I met with the same problem ( I think it is because the system does not know how to execute the file. Also be aware of the difference between the shell form and exec form of |
just adding #!/bin/bash to my entry point file fixed the issue. |
@khalidumarr, which version of buildah are you using? Did you execute with |
i was using docker run directly. |
Why should there be a shebang in |
We build with an wrong architecture... and then: Our Image is for godeployment and we get this error. Maybe it will help somebody.. |
@TrayserCassa What error? |
@rhatdan |
There is probably a good change the runc version is out of date. |
Turns out the #!/bin/bash was in my entry point file, but since I did a copy and paste into that file, the first line was a newline, not the #!/bin/bash, effectively ignoring it. If this helps anyone as well. Deleted the empty line and all worked fine. |
@adambant TYVM for the follow up and info on your work around. |
FWIW - I had the same error (copied below) with a ruby container and the problem was due to a missing shebang in my ruby program. I was using CMD instruction in a exec form (CMD instruction copied below) Error
CMD:
|
good. best quality .. answer very very good |
in my case the entrypoint.sh had the wrong shebang |
In case anyone finds this useful, you can get this issue if your shell script uses CRLF for line endings and/or UTF-8 with BOM (e.g. if you created a shell script file in Visual Studio). Changing to LF only and straight UTF-8 fixed it for me. |
Thanks soooooo much!!!! Now... I have a new error: /bin/bash: /docker-entrypoint.sh: Permission denied =( =( |
@limup can you open a new issue please and send us details if you've not figured out the issue yet? |
Well, I fixed the problem. I added the command in the Dockerfile and execute:
[~See ya] |
Thanks for the follow up and solution @limup ! |
@limup I would rather you called it container-entrypoint, and ran it with podman :^) |
@limup Podman is a related project to Buildah. It lives under the libpod project at: https://github.com/containers/libpod and has it's own website https://podman.io. In short, it's a OCI compliant container system. |
Thanks for sharing it. |
For anyone who got a Replacing |
By entry point, it means to the top of the .sh file itself. For some people, it might not be clear. |
Ahhh! This was my problem! Thank you so much!!! |
Thanks, this worked for me. |
where is this file? |
entrypoint.sh |
In my case i needed to install https://github.com/multiarch/qemu-user-static |
Download below two files to a directory and build an image from it.
https://github.com/docker-library/hello-world/tree/master/amd64/hello-world
https://github.com/docker-library/hello-world/blob/master/amd64/hello-world/hello
on RHEL 7.4, it throws an error as below. No this error on Fedora 27.
The text was updated successfully, but these errors were encountered: