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

How can an arm64 server without Internet use it to run the docker image of AMD64? #161

Closed
HelloGril opened this issue Dec 16, 2021 · 16 comments

Comments

@HelloGril
Copy link

HelloGril commented Dec 16, 2021

Description:
I need to run an AMD64 docker image on an arm64 server. This server cannot access the network. What should I do? Ask for help. Thank you very much !

Environment:
Linux localhost.localdomain 4.19.90-23.8.v2101.ky10.aarch64 #1 SMP Mon May 17 17:07:38 CST 2021 aarch64 aarch64 aarch64 GNU/Linux
docker:Docker version 19.03.9, build 9d98839
docker image:"Architecture": "amd64"

@martin-g
Copy link

You need to use https://dbhi.github.io/qus/ instead of qemu-user-static.
Please read https://martin-grigorov.medium.com/build-linux-software-for-foreign-cpu-architectures-on-arm64-463a95d15460

Since you don't have Internet access you will need to provide all dependencies "manually", e.g. docker save/load, see https://kuberty.io/blog/how-to-export-a-docker-image/

@HelloGril
Copy link
Author

Thank you very much for answering my question!
Now let me show you my operation steps. Please give me some advice
Step1:I execute the following commands on the x86 machine
50bf7c1e1f632414994346a59538602
Step2:I save images from x86 machines
53184c06132e6ee79863c35a6e1de61
Step3:I load images from arm64 machines
3f6bea8e230a4f86cf4d096f49680c5
eb73ddb15b789bf0fecae1a8b09e535
Step4:Execute"docker run --rm --privileged aptman/qus -s -- -p"
7e5f18d28f5208557d5845da9334094

An error occurred:standard_init_linux.go:211: exec user process caused "exec format error"

So I need your help again. Thank you very much!

@martin-g
Copy link

You saved a x86_64 image and tried to load it on aarch64 host, thus wrong exec format.
You need to save the aarch64 image instead.
See https://stackoverflow.com/questions/60114854/pull-docker-image-for-different-architecture for few possible ways to do it.

@HelloGril
Copy link
Author

HelloGril commented Dec 22, 2021 via email

@martin-g
Copy link

What service ?

@HelloGril
Copy link
Author

HelloGril commented Dec 22, 2021 via email

@martin-g
Copy link

Without more information about the container and the errors (do you get any errors when executing ps ?!) we cannot help you more.

@HelloGril
Copy link
Author

HelloGril commented Dec 22, 2021 via email

@martin-g
Copy link

I have the feeling you try to run armv8 Docker container on armv7 hardware/host.

@HelloGril
Copy link
Author

HelloGril commented Dec 22, 2021 via email

@martin-g
Copy link

Could you please paste the output of lscpu and uname -m ?

@HelloGril
Copy link
Author

HelloGril commented Dec 22, 2021 via email

@martin-g
Copy link

I hope you understand that those  s makes it real hard to find the meaningful text!
We talk about the armv8 host. Why uname -m returns x86_64 ?!

@HelloGril
Copy link
Author

HelloGril commented Dec 22, 2021 via email

@martin-g
Copy link

martin-g commented Dec 22, 2021

OK! I guess to run it following my article.
Please open a new issue at https://github.com/dbhi/qus/issues giving as much details as possible about the host, the container and the commands you use to start the container and the errors you face.
I think this issue could be closed since it is no more related to qemu-user-static

@HelloGril
Copy link
Author

HelloGril commented Dec 22, 2021 via email

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

2 participants