To cross-compile with Rust, the cross program exists. To use it Docker needs to run without root permissions (it does) and cross needs to be installed, with e.g. cargo install cross -f (it is). I did this without root rights.
But if I run in the same terminal cross, I always get an error: "cross: Command not found.", even after a restart. Despite every tutorial telling me cargo install cross... should be enough.
Edit: I saw that the problem is that "~/.cargo/bin/" wasn't added to the path variable.
Edit 2: I used the recommended way to install Rust with rustup, but cargo was put into /snap/bin/cargo (maybe thanks to Ubuntu?). While I think I can fix my problem with adding ~/.cargo/bin to my path variable, I would like to know what's the best way, so everything is put into the same place.
(I use Ubuntu 20.04.6 LTS on an AMD64 platform.)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh, suggested from "rust-lang.org/tools/install". The difference is, that my cargo bin landed in "/snap/bin/cargo" (I think thanks to Ubuntu) and not in "~/.cargo/bin", which is the directory where it should land according to the official rustup website.