Standard init linux go 211 exec user process caused exec format error

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

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

Comments

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?

The text was updated successfully, but these errors were encountered:

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 /]# 

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 😆 .

Читайте также:  Convert odt to pdf linux

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

@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.

I never heard of dockcross before.

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

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.

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.

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 

Источник

Читайте также:  Linux sudo edit file

app_1 | standard_init_linux.go:211: exec user process caused «exec format error»

I have a golang application and I created dockerfile, which make multi-stake build. But I catch this error app_1 | standard_init_linux.go:211: exec user process caused «exec format error» every time when try to do docker-compose up . Dockerfile:

 # Start from the latest golang base image FROM golang:1.13 as builder # Set the Current Working Directory inside the container WORKDIR /memesbot # Copy go mod and sum files COPY go.mod go.sum ./ # Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed RUN go mod download # Copy the source from the current directory to the Working Directory inside the container COPY . . # Build the Go app RUN go build -o /memesbot/cmd/main . ######## Start a new stage from scratch ####### FROM alpine:latest RUN apk --no-cache add ca-certificates WORKDIR /root/ # Copy the Pre-built binary file from the previous stage COPY --from=builder /memesbot/cmd/main . RUN chmod +x ./main # Command to run the executable CMD ["./main"] 
version: '3' services: app: build: context: . dockerfile: Dockerfile ports: - "7777:7777" environment: TELEGRAM_TOKEN: xxxx 

It doesn’t work, I changed FROM golang:1.13 as builder to FROM golang:1.13-alpine as builder and have the same error app_1 | standard_init_linux.go:211: exec user process caused «exec format error»

This is not a problem with Docker, but with the golang code. Beside using /root/ as working directory (which I wouldn’t advice) the rest is correct. I used your Dockerfile and a basic go application and everything works fine. Try to start the container without CMD and then connect to it and run your program inside the container — this might give you more information.

Читайте также:  Linux самую большую директорию

Источник

Docker: standard_init_linux.go:211: exec user process caused «no such file or directory»

I am able to compile the C program and execute locally I am able to build the image using the dockerfile but when I try to run the container, I get the below error:

 # docker run -i hello standard_init_linux.go:211: exec user process caused "no such file or directory" # 

I expect the container to run successfully and print «Hello World» on console. most of the answers provided are asking to change EOL which is not applicable as we are already on Linux and not trying to run script.

2 Answers 2

I guess you get this error because you built out a dynamic linked binary like next:

$ gcc -o hello hello.c $ ldd hello linux-vdso.so.1 (0x00007ffe3b1ec000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7fe1fc7000) /lib64/ld-linux-x86-64.so.2 (0x00007f7fe25ba000) 

The scratch is really basic which do not have so many so for your binary to dynamic link. So, you need to build out a static link binary, like:

$ gcc -o hello -static hello.c $ ldd hello not a dynamic executable 

Then, it will be work like next:

$ docker build -t hello . Sending build context to Docker daemon 848.4kB Step 1/3 : FROM scratch ---> Step 2/3 : COPY hello / ---> 9d594b34f774 Step 3/3 : CMD ["/hello"] ---> Using cache ---> 2f1bad3099d3 Successfully built 2f1bad3099d3 Successfully tagged hello:latest $ docker run -i hello Hello, World! 

And, if you do not use scratch image which have more .so in the system, then you no need to build out static binary.

Источник

Оцените статью
Adblock
detector