Can box64 run docker images for amd64 on Raspberry Pi 4?
Hi,
I'm Mr. Temple, a very friendly guy.
Can box64 run docker images for amd64 on Raspberry Pi 4?
I don't think that's the intended purpose for Box64. I can say Box64 works well to take an x86 application, put it inside a container with Box64 and run that way. example here.
I tried this:
docker run --env "BOX64_LOG=1" -it --entrypoint=/bin/bash rknn-toolkit2:1.6.0
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
standard_init_linux.go:219: exec user process caused: no such file or directory
hmmm, something is missing... qemu-user-static (or packed version: https://github.com/dbhi/qus) works this case, but the speed is so slow. It would be great if box64 support this case.
Some parts of the answer is: Docker takes advantage of binfm_misc to help it run non native binaries (x86 on arm for example). This allows it to use Qemu-user-static to interpret the container’s contents. But the part of Box64’s special sauce is that it will catch the library hooks and call native binaries for speed. (I’m guessing this is the reason for this use case not working is) Inside the container those libraries are not there. (Maybe someone with a better understanding can confirm?)
looks like changes are in place for having Box64 outside of the container.... see https://github.com/ptitSeb/box64/commit/13404ed090453ffa1a2b475b004b74db7086ff74
Yes, box64 should be buildable as a static binary (with limited wrapped capability) for docker use. It's untested and experimental tho....
@ptitSeb Hello. I've got it running amd64 docker images on arm64 machine by mounting host /lib into the container (In detail, I renamed the original /lib to /lib.box64 and set BOX64_LD_LIBRARY_PATH=/lib.box64). Then, I had to match host glibc version and guest glibc version to support deprecated functions because the container wanted to use them. I've done this by manually editing the wrappedlibc_private.h and other header files. Is there any way to do this cleanly? Is it possible to make use of wrapperhelper to generate libc header for specific glib version from the scratch?