Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Anyone had success with compose-based devcontainers in Qt Creator
Qt 6.11 is out! See what's new in the release blog

Anyone had success with compose-based devcontainers in Qt Creator

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
devcontainerdockercompose
2 Posts 2 Posters 246 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    galkinvv
    wrote on last edited by
    #1

    Recently I tried switching c++-with-cmake-in-docker linux project (on linux host) to the .devcontainer.json development model using Qt Creator.

    While the document lacks full examples, I succeded with building the project within Qt Creator with image-based .devcontainer.json like this (only image name and paths changed from my real project)

    {
      "name": "qtc",
      "customizations": {
            "qt-creator": {
                "auto-detect-kits": false,
                "kits": [
                    {
                        "name": "qtckit",
                        "compiler": {
                            "Cxx": "/usr/bin/g++",
                            "C": "/usr/bin/gcc"
                        },
                        "cmake": {
                            "binary": "/usr/local/bin/cmake",
                        }
                    }
                ]
            }
     },
      "image": "ams21/cmake:3.30.6",
      "workspaceFolder": "/opt"
    }
    

    However, I really want to pass some extra options during container creation, so I tried swithced to compose-based-dontainer, replacinf the image line with 2 new lines

      "dockerComposeFile": ["docker-compose.qtc.yaml"],
      "service": "sigleservice",
    

    and, as a starting point create simplest compose file like

    services:
      sigleservice:
        image: ams21/cmake:3.30.6
        command: ["/bin/sh", "-c", "while sleep 1000; do :; done"]
    

    And - suddenly Qt creator fails to find cmake inside dev container, reporting "Cannot create cmake tool" error after ending of [Probe User Environment]. On image-based container it reports the success with CMake like `Found CMake tool: "devcontainer://c41a7ce5fa608110ee3836c3c0d912af49b34347376cbf6fa9b1cb6bd3960d05/usr/local/bin/cmake"

    In my case it turned out that Qt Creator failed to copy or mount the cmd bridge inside the container. Manualy adding

        volumes:
        - /laptop/opt/qtcreator/libexec/qtcreator/:/devcontainer/libexec
    

    in the compose file resolved the issue.

    Was I doing something wrong or default settings for dockerComposeFile-based devcontainers are not-ready-for-general-usage yet?

    K 1 Reply Last reply
    0
    • G galkinvv

      Recently I tried switching c++-with-cmake-in-docker linux project (on linux host) to the .devcontainer.json development model using Qt Creator.

      While the document lacks full examples, I succeded with building the project within Qt Creator with image-based .devcontainer.json like this (only image name and paths changed from my real project)

      {
        "name": "qtc",
        "customizations": {
              "qt-creator": {
                  "auto-detect-kits": false,
                  "kits": [
                      {
                          "name": "qtckit",
                          "compiler": {
                              "Cxx": "/usr/bin/g++",
                              "C": "/usr/bin/gcc"
                          },
                          "cmake": {
                              "binary": "/usr/local/bin/cmake",
                          }
                      }
                  ]
              }
       },
        "image": "ams21/cmake:3.30.6",
        "workspaceFolder": "/opt"
      }
      

      However, I really want to pass some extra options during container creation, so I tried swithced to compose-based-dontainer, replacinf the image line with 2 new lines

        "dockerComposeFile": ["docker-compose.qtc.yaml"],
        "service": "sigleservice",
      

      and, as a starting point create simplest compose file like

      services:
        sigleservice:
          image: ams21/cmake:3.30.6
          command: ["/bin/sh", "-c", "while sleep 1000; do :; done"]
      

      And - suddenly Qt creator fails to find cmake inside dev container, reporting "Cannot create cmake tool" error after ending of [Probe User Environment]. On image-based container it reports the success with CMake like `Found CMake tool: "devcontainer://c41a7ce5fa608110ee3836c3c0d912af49b34347376cbf6fa9b1cb6bd3960d05/usr/local/bin/cmake"

      In my case it turned out that Qt Creator failed to copy or mount the cmd bridge inside the container. Manualy adding

          volumes:
          - /laptop/opt/qtcreator/libexec/qtcreator/:/devcontainer/libexec
      

      in the compose file resolved the issue.

      Was I doing something wrong or default settings for dockerComposeFile-based devcontainers are not-ready-for-general-usage yet?

      K Offline
      K Offline
      kevin009
      wrote last edited by
      #2

      @galkinvv Thanks for your workaround for this. It got me up and running.

      According to this We should be able to use mount-libexec and libexec-mount-point for this. However, I tried them and they don't work.

      Have you found out anything more about this?

      Kevin

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved