Closed ToneVDB closed 2 years ago
@ToneVDB at first glance I'm confused as to why a docker image wouldn't be able to run an executable due to its host architecture. The only thing we could change is providing binaries for arm, which might be a good thing to do anyway.
@ToneVDB and I investigated together and concluded that his docker engine was configured to use linux/arm64, which leads to incompatibility with the amd64 binary.
For future reference, if anyone experiences docker issues with their arm chips, have a look at https://stackoverflow.com/a/69636473/1498043. You can configure Docker to make use of the linux/amd64 platform instead of linux/arm64. This can be configured in multiple ways: an environment variable, a Dockerfile FROM option, a docker compose platform
property and possibly there are other ways as well.
Context:
I have the below dockerfile on an M1 mac:
I build the image with the command
docker build . --tag testimage
We enter it viadocker run --user 0 -it testimage /bin/bash
Behaviour:
Running the command
sbot --help
renders the following output:qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
Expected behaviour:
sbot --help
should output the help optionsTemporary solution:
Build the dockerfile using the command:
docker build . --tag testimage --platform linux/x86_64
Run the image using the command:docker run --platform linux/x86_64 --user 0 -it testimage /bin/bash
sbot --help
now outputs the correct informationIs this by design or a bug in docker or sbot?