I have constructed an x86 docker container, containing an armv8 gcc toolchain for cross-compilation of my C++ software. The idea is that I can use the docker container to cross-compile my software and then transfer the resulting binaries to a Raspberry Pi. This all works fine, manually.
What I'd like to do is integrate this with JetBrains CLion, somehow. I know that a docker container can be set up as a Remote Host (via ssh), but this would build and try to execute the binaries within the container. What I'd like to do instead is build the binaries within the container, then deploy them to an alternative Remote Host (i.e. the Raspberry Pi) for execution, and eventually debugging.
Is there an appropriate workflow supported by CLion? Is it possible to configure a Toolchain remote host and a separate Deployment remote host? From what I can see CLion only lets you select a single environment (i.e. CMake config) for a build, and that is where the resultant binary ends up executing.
It's ok to have multiple processes, but to get the most benefit out of Docker, avoid one container being responsible for multiple aspects of your overall application. You can connect multiple containers using user-defined networks and shared volumes.
If you are having trouble with Docker containers or images, you can turn on debug mode on your Docker daemon. Enabling debugging provides more verbose output from the daemon and you can use this information to find out more about why your containers or images are having issues.
Consider this alternative setup: build an armv8 container (with docker buildx) and include a native gcc toolchain. Then, docker can run that container in qemu with something like qemu-user-static. This allows you to build and debug directly in the container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With