c++dockerclion

Clion Docker toolchain with ssh


I am using CLion to develop a set of libraries in C++. We have a set of versions that are not compatible between each other, so instead of removing the latest versions from my computer and installing the old ones in order to fix a bug, I decided to use the Docker Toolchain of CLion.

I have had no problem so far. However, my last change was to add cmake FetchContent that points to an internal repo. My problem is: I cannot clone the repo on the container when setting up the project from CLion. There is no option to use my ssh keys on the configuration, however when I run the base container "standalone" (I mean, without CLion) I have no issues on cloning the repo..

Is there a way to solve this?


Solution

  • Just mounting the .ssh folder as explained by @Botje works, the only consideration is that the current user in the container should have the same UID:GID as the owner of the .ssh folder.

    My container was running a root user, and my uid/gid was 1000, so I could not use the ssh keys. To solve this, I have created a user in the image with the same uid/gid as mine.