qtCreator and docker best practises

Viewed 1108

What are the best practises for using docker from within an IDE such as qtCreator?

  1. Should you install qtCreator within the container?

  2. Should you code on the host and only build within the container via a shared mounted volume? And in this case do you have to manually start the run / debug from within the container rather than running / debugging via ctrl+r or F5 within qtCreator (this would be a pain no longer being able to use shortcuts ctrl+r or F5)

1 Answers

Great question. I'm currently looking for an answer. My experience suggests to mount the tool folder in the container. Don't forget to mount folders with user settings.

I previously tried to put QtCreator inside the container: worst choice. The container size grows up and you also miss all the user settings once you remove the container. I also tried to run a container at every compile command. This is a quite good choice. It's also possible to run the container at every run command and attach the debugger to the container like you would for a remote host.

The problem is: where are your project dependencies? On your local host, with your source code? Or inside the container? If they are inside the container, you miss all the suggestions and auto-completion of your IDE, because it can't see dependecy code inside the container.

VS Code has an architecture to develop completly inside a container, mounting only your source code.

I'm still making some experiments to find the better solution.

Related