Devcontainer: Custom toolchain is forgotten on restart
I have a devcontainer defined by a devcontainer.json file.
I open the project. I'm prompted to re-open in the container. I do. I create a cmake profile called “Debug-Icecream”. When I go to manage toolchains, I create a custom toolchain called “Icecream” pointing to my compiler (non-standard path). I can succesfuly build my project.
However, the next time I open the project and then re-open in container, my custom toolchain appears to be gone. In the cmake window I see “Toolchain ‘Icecream’ not found”.
I've also tried creating the Icecream toolchain before re-opening in container, but I get the same results.
I can go to “Configure” and re-create it, but of course, I'd prefer not to have to re-define my toolchain every time I open/close CLion. What's the preferred way to keep the toolchain defined between clion/container restarts?



Please sign in to leave a comment.
Hello, Benjaminaaronblumer.
Please note that the Reopen in Container action creates a new container each time - that's why your settings are lost. I'd recommend you open the already created dev container from the
File | Remote Development…
window orRemote Development | Dev Containers
node in the Welcome screen:Thanks for this – that makes sense.
Though, every once in a while, the docker container will go down / be shut down. Is there another way to save these settings? Perhaps by mounting a config file somewhere?
Could you please try to copy from the current container and add the
/.jbdevcontainer/config/JetBrains/Clion<version>/options/linux/toolchains.xml
file into the dev container setup, for example, by moving it to the image via the Dockerfile?Thanks for the tip, Olga! So far, seems like it's working.
For future others to repro:
1) Load .devcontainer.json container.
2) Copy /.jbdevcontainer/config/JetBrains/CLion2025.1/options/ to host via a mount.
3) Stop remote dev container. Kill docker containers.
4) modify devcontainer.json to include a mount to the options dir:
5) Startup devcontainer from .devcontainer.json.
6) Create custom toolchain.
7) `cat
/.jbdevcontainer/config/JetBrains/Clion<version>/options/linux/toolchains.xml
` see the changes.8) kill docker container / devcontainer
9) Restart from the .devcontainer.json
10) Toolchain preserved!