Docker Community Forums

Share and learn in the Docker community.

Debugging an app by an IDE with a Docker development environment

Background

I was using a laptop with openSUSE Leap 15.1 to develop a Qt app. I upgraded to openSUSE Tumbleweed. Now I realize that library versions which my app is dependent upon are not available for Tumbleweed. Now I have these options:

  1. Reinstall openSUSE Leap 15.1 (or maybe 15.2?)
  2. Set up a development environment with some Docker images
  3. Set up a development environment with a virtual machine
  4. Unavailable dependencies: grab their binary packages directly and install them manually on openSUSE Tumbleweed

Question

I’m curious about 2nd option i.e. Docker.

I know how to use Docker to deploy the app. You set up the development container with all the dependencies and run some deployment scripts with it.

However, I don’t know:

Is it possible to set up Docker containers in a way that Qt Creator debugger can be used for development? If I use Docker, would I be able to step through the code with Qt Creator debugger?

Plan

Is this scenario possible?

  1. Pull an openSUSE Leap 15.1 Docker image
  2. Set up a bindmount volume that links the /usr/lib64/ directory from inside the container to the ~/leaplib directory on the host machine. It means ~/leaplib:/usr/lib64/
  3. Do the same for development headers i.e. ~/leapinclude:/usr/include/
  4. Bindmount procedure is explained here
  5. Install all the Qt project dependencies on the openSUSE Leap 15.1 container
  6. Therefore, all dependency libraries and header files would be installed inside the container bindmount volumes
  7. Inside Qt Creator project on the host machine, add ~/leaplib to library path
  8. Inside Qt Creator project on the host machine, add ~/leapinclude to include path
  9. The Qt project source code repository is of course on the host machine
  10. Use Qt Creator to open project repository source code
  11. You should be able to develop and debug the code with Qt Creator debugger, right?

The above plan is not tested yet. Not sure if it would work. Any idea? Am I missing something?