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

standard_init_linux.go:211: exec user process caused "exec format error" #410

Closed
JonasVautherin opened this issue Dec 20, 2019 · 13 comments
Closed

Comments

@JonasVautherin
Copy link

I cannot reopen #406, but I believe I have the exact same problem.

I try to run the following:

docker run --rm -it quay.io/pypa/manylinux2014_aarch64 /bin/bash

And I get the following output:

standard_init_linux.go:211: exec user process caused "exec format error"
failed to resize tty, using default size

I am running on Arch Linux, on Docker version 19.03.5-ce, build 633a0ea838.

Any idea where that error may come from?

@JonasVautherin
Copy link
Author

JonasVautherin commented Jan 8, 2020

For the record, this issue shows the exact same error message, but for a completely different image (gitlab/gitlab-ce, nothing to do with manylinux).

There, they say:

The gitlab/gitlab-ce container is built for x86_64 architecture. You will need to run the container on system that has the x86_64 architecture.

Hence my question: who can run quay.io/pypa/manylinux2014_aarch64, and on which architecture are you running it?

@hrw: wondering if you can run this image on your side?

@hrw
Copy link
Contributor

hrw commented Jan 8, 2020

exec user process caused "exec format error" means "you are trying to run container for other architecture.

"quay.io/pypa/manylinux2014_aarch64" can be run on aarch64:

11:24 (0s) hrw@j13-qrep-04:~$ docker run --rm -it quay.io/pypa/manylinux2014_aarch64 bash
Unable to find image 'quay.io/pypa/manylinux2014_aarch64:latest' locally
latest: Pulling from pypa/manylinux2014_aarch64
3f2696f8166f: Already exists 
d068d07f487c: Pull complete 
4d790fefbfde: Pull complete 
Digest: sha256:c394f3322b0b42fc24cd8b44005b24a06719f05d3b987e0d9310f8161ffc7f59
Status: Downloaded newer image for quay.io/pypa/manylinux2014_aarch64:latest
[root@8989da8045ba /]# uname -a
Linux 8989da8045ba 5.4.0-1-arm64 #1 SMP Debian 5.4.6-1 (2019-12-27) aarch64 aarch64 aarch64 GNU/Linux
[root@8989da8045ba /]# cat /etc/centos-release
CentOS Linux release 7.7.1908 (AltArch)
[root@8989da8045ba /]# 

@JonasVautherin
Copy link
Author

Oh, I thought I could use it for cross-compiling, actually. I guess I got confused because I'm using dockcross, and I'm not used to running Docker on arm devices 😆.

Thanks a lot!

@hrw
Copy link
Contributor

hrw commented Jan 8, 2020

@JonasVautherin and I am not used to running Docker on x86 ;D

@JonasVautherin
Copy link
Author

@hrw: I am now wondering how one would create a dockcross/manylinux2014-aarch64 image (i.e. one that would actually cross-compile). I opened an issue in the dockcross repo, if you (or somebody else) have insights.

My understanding is that pypa/manylinux2014-aarch64 uses CentOS 7 as a base image, but if I wanted to cross-compile, I would need to import a toolchain from that, somehow.

@hrw
Copy link
Contributor

hrw commented Jan 8, 2020

I never heard of dockcross before.

There are several CI options available with AArch64 support. AWS has EC2 instances etc.

@storkinsj
Copy link

Hey folks, FYI I saw an answer on stackexchange recently that seemed to nail this redherring error message. In their case, and in my case, the problem was that the execute permission was not set on the execution target. You may want to chmod+x to the execution target in your Dockerfile/Docker build and try again.

@formigone
Copy link

Hey folks, FYI I saw an answer on stackexchange recently that seemed to nail this redherring error message. In their case, and in my case, the problem was that the execute permission was not set on the execution target. You may want to chmod+x to the execution target in your Dockerfile/Docker build and try again.

To build off that, if your execution target happens to be a shell script of the likes, be sure that you also have a shebang appropriate to that.

@JonasVautherin
Copy link
Author

For the record, dockcross now has manylinux2014-aarch64 thanks to @odidev 🎉.

@ShaneHarvey
Copy link
Contributor

exec user process caused "exec format error" means "you are trying to run container for other architecture. "quay.io/pypa/manylinux2014_aarch64" can be run on aarch64

@hrw this cannot be true, can it? I can run the manylinux2014_aarch64 image successfully on my macOS which is x86_64 not aarch64:

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.5
BuildVersion:	19F101
$ uname -a
Darwin Shanes-MacBook-Pro.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
$ docker run --rm -it quay.io/pypa/manylinux2014_aarch64 bash
[root@6475fee4244c /]# uname -a
Linux 6475fee4244c 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
[root@6475fee4244c /]# exit

I can also run manylinux2014_ppc64le and manylinux2014_s390x too:

$ docker run --rm -it quay.io/pypa/manylinux2014_ppc64le bash
[root@0448013ebe45 /]# uname -a
Linux 0448013ebe45 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux
[root@0448013ebe45 /]# exit
$ docker run --rm -it quay.io/pypa/manylinux2014_s390x bash
bash-4.2# uname -a
Linux de1e669b4e64 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 s390x s390x s390x GNU/Linux
bash-4.2# exit

@rehadiri
Copy link

I am trying to install Mavsdk on Raspberry pi 4 Raspberry OS Buster Lite. I have installed and checked the docker. It works fine . After that i entered the following command

docker run --rm dockcross/linux-armv7 > ./dockcross-linux-armv7

It installed the dockcross/linux-armv7 image on the docker
But at the end i have got "standard_init_linux.go:211: exec user process caused "exec format error"

I have looked at the dockcross-linux-armv7 in the MAVSDK folder . Its empty , 0 bytes.

What can go wrong here ?
Thanks
Best Regards
Reha

@tedz2usa
Copy link

tedz2usa commented Jul 20, 2021

I'm new to making Docker containers work cross-platform, especially using an Apple M1-chip laptop for development. But so far what worked for me is to specify the platform linux/amd64 during the build step.

$ docker build -t MY_IMAGE_NAME --platform=linux/amd64

Even better, to help me know that a build is for that platform, I'll give this specific image a tag of the string "amd64":

$ docker build -t MY_IMAGE_NAME:amd64 --platform=linux/amd64

My comment is not necessarily related to the pypa project, but just wanted to mention how I solved (worked around) the standard_init_linux.go:211: exec user process caused "exec format error" error.

I'm able to then run MY_IMAGE_NAME:amd64 on my laptop (I have rosetta enabled in my laptop's terminal) and on standard x86 cloud servers.

I'm next going to look into using the new docker manifest feature to make one image work on multiple different platforms. https://docs.docker.com/engine/reference/commandline/manifest/#inspect-a-manifest-list , which should help aid in a better long-term solution for all this.

@reuben
Copy link

reuben commented Aug 1, 2021

You need to enable emulation before running the aarch64 image on x86_64 will work on Linux. I assume it works out-of-the-box on macOS because Docker is already using a full blown virtual machine by default there. On Linux it uses QEMU. Run the following command:

docker run --privileged --rm docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64

Some more info here: https://www.docker.com/blog/multi-platform-docker-builds/

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

No branches or pull requests

8 participants