but after testing the same dockerfile on a raspberry pi running docker i dont get the same error
@diogovaraujo, there are a few different ways of deploying applications / app containers to a balenaOS device, mostly described on this page: https://www.balena.io/docs/learn/deploy/deployment/
For example, if you use the
git push or
balena push <app-name> methods to deploy the application, the balenaCloud builder will build the images (run the Dockerfile), typically using native ARM cloud servers (with hardware support for the specific instruction set of the target devices, like the RPi3). QEMU is not necessarily used by the balenaCloud builder.
By contrast, other deployment methods like
balena build and
balena deploy --build, either with balenaCloud or openBalena, may rely on QEMU to build on the local computer (running Docker). This varies further depending on the host OS and the Docker version: Docker Desktop for Windows or macOS don’t require QEMU thanks to binfmt_misc, whereas Docker for Linux typically doesn’t have binfmt_misc enabled.
A third option that also avoids the need for QEMU is to use
balena build or
balena deploy --build with the
--dockerPort command line options to point to the IP address and port number of a local device (e.g. RPi3) running a development image of balenaOS, such that a native target processor (ARM) is used to build the image.
Given the above, to narrow the issue you’re having, some relevant questions are:
- Which host OS / method do you use when “testing on a raspberry pi running docker” - e.g. Raspbian?
- Which deployment method do you use in order to “run the toolchain on the device”? E.g.
balena deploy, etc.
- Could you share the Dockerfile as well? And copy-and-paste of error messages?
Sharing commands lines would be helpful too.
Also: when you say “segmentation faults”, is there any chance that it is cause by mismatched architectures? For example, an image that was built on a laptop using an x86 target, which somehow gets run on an ARM device. The answers to the questions above (deployment method) should help clarify it.