Cross compile for Raspberry Pi with Docker
The Raspberry Pi is a pretty useful tool for quickly prototyping some IoT product, simulating an embedded environment, running a small Kubernetes cluster, etc; there are probably lots of reasons why you’d want to use one (or maybe not?).
As for developing software that can run on it, if you’re writing it in C or C++, there’s many ways to go about it:
- Sync the code changes you make on the Pi and build it natively on it (via rsync, scp, SSHFS, git, etc)
- Use crosstool-ng to setup a toolchain and use it to cross-compile your software; then copy the resulting binaries onto the Pi
- Use a precompiled toolchain to cross-compile the software; then copy the binaries onto the Pi
- Develop directly on the Pi through an SSH session
- Use a containerized OS such as Balena
And you can probably find many other creative ways developers came up with.