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

use --network=host how to qemu-x86_64-static #208

Open
xjj1001 opened this issue Dec 5, 2024 · 0 comments
Open

use --network=host how to qemu-x86_64-static #208

xjj1001 opened this issue Dec 5, 2024 · 0 comments

Comments

@xjj1001
Copy link

xjj1001 commented Dec 5, 2024

/kind question

  1. I started a Docker container with x86_64 architecture and installed qemu-x86_64 static using binary packages in the container
docker run -it --rm --privileged --net=host --name temp-x86-container x86-image-name:tag
  1. Then I will export this container and upload it to my arm64 architecture server
docker export temp-x86-container > temp-x86-container.tar
  1. Afterwards, load this image on my arm64 architecture server using the following method
docker import -c "ENTRYPOINT /usr/bin/qemu-x86_64-static /bin/sh" temp-x86-container.tar arm-image-name:tag
  1. I started a container using this image and used the webstart command to start a web service inside the container
docker run -it -net=host --name arm-container arm-image-name:tag webstart

But I found that I cannot access this web service on the host computer
After entering the container, I found that the IP address inside the container was not the same as the host machine. It seems that the host mode has no effect on qemu-x86-64-static. How can I correctly use qemu-x86-64-static to achieve service access

qemu-user-static version : v5.2.0-11

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

1 participant