CLion - build within a docker container, but deploy for execution/debugging to a different host
Asked Answered
S

1

10

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.

Shayna answered 25/9, 2019 at 4:13 Comment(0)
L
2

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.

Lexis answered 14/12, 2021 at 20:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.