-
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
arm64 - fork/exec /bin/sh: exec format error #3183
Comments
I tested removing the line |
Any idea how I can solve this problem? |
I'm also running into this issue. I have a shell script which I copy in and attempt to run -- it works fine when building for I get the same error message as @ricardorqr:
I'm using
Advice appreciated, let me know if I can add any more context. |
Hi @cwboden, I have to say that you made me dig into my old repositories for this solution. Alright, let me try to explain step by step. First, here are a few resources I had to read to understand this problem.
Second, since I have Docker running in this ec2 where Jenkins is deployed, I had to run QEMU as an image using this command. sudo docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
sudo docker buildx ls This was the output: + sudo docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
Unable to find image 'docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64' locally
a7996909642ee92942dcd6cff44b9b95f08dad64: Pulling from docker/binfmt
5d6ca6c8ba77: Pulling fs layer
b26a8e2c75fc: Pulling fs layer
3436361ddd98: Pulling fs layer
3436361ddd98: Download complete
b26a8e2c75fc: Verifying Checksum
b26a8e2c75fc: Download complete
5d6ca6c8ba77: Verifying Checksum
5d6ca6c8ba77: Download complete
5d6ca6c8ba77: Pull complete
b26a8e2c75fc: Pull complete
3436361ddd98: Pull complete
Digest: sha256:758ca0563f371b384cfd67b6590b5be2dc024fef45bc14a050ae104f0caad14e
Status: Downloaded newer image for docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
+ sudo docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
default * docker
default default running v0.8+unknown linux/amd64, linux/386, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/arm/v7, linux/arm/v6 If you run this command After that, I was able to run the command to create the image for ARM64. Here is my code. # Rum QEMU to emulate arm64
# https://www.reddit.com/r/docker/comments/13pcihm/cant_get_arm64_image4_to_build/
sudo docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
sudo docker buildx ls
# Create images
modified_string=$(echo "${BUILD_ID}-${BRANCH}-${BUILD_NUM}" | tr '/' '-')
aws ecr get-login-password --region us-east-2 | sudo docker login --username AWS --password-stdin 123456789.dkr.ecr.us-east-2.amazonaws.com
# Create amd64 image
sudo docker buildx build --platform=linux/amd64 -t 123456789.dkr.ecr.us-east-2.amazonaws.com/XXXXX:$modified_string-amd64 -f Dockerfile . --push
# Create arm64 image
sudo docker buildx build --platform=linux/arm64 -t 123456789.dkr.ecr.us-east-2.amazonaws.com/XXXXX:$modified_string-arm64 -f Dockerfile . --push
# Create multi architecture image
sudo docker manifest create 123456789.dkr.ecr.us-east-2.amazonaws.com/XXXXX:$modified_string \
123456789.dkr.ecr.us-east-2.amazonaws.com/XXXXX:$modified_string-arm64 \
123456789.dkr.ecr.us-east-2.amazonaws.com/XXXXX:$modified_string-amd64
sudo docker manifest push 123456789.dkr.ecr.us-east-2.amazonaws.com/XXXXX:$modified_string I hope it helps. |
i have the same case,My temporary solution is to run 2 tasks one on an arm64 machine and one on an amd64 machine |
Hi team
I have a Jenkins pipeline which creates a multi-architecture image using Kaniko. I'm following this tutorial: https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-multi-architecture-image.html
This is my pipeline
This is my Dockerfile. As you can see it is a very simple one.
And this is the error.
It fails when it executes the line
RUN yum install -y procps && yum clean all
. I have other pipelines that don't have any command (RUN) to perform, so they are working. If I remove the stageBuild image - arm64
, the stageBuild image - amd64
works. I'm also using--custom-platform
. It seems this error is related to arm64. I'm not sure.Any idea how can I silver this?
The text was updated successfully, but these errors were encountered: