From 2d921e721d4a17a906d7ed49dee80a67c856beb3 Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Thu, 9 Apr 2026 21:18:37 +0000 Subject: [PATCH 1/7] Move Inside the Container up IMHO it describes how to do first steps as a new container user and should not be hidden under tons of text. --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e51c37f..ddceca3 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,19 @@ Afterwards, Visual Studio Code should show this in the lower left corner of your ![Dev container success](resources/devcontainer_success.png) +### Inside the Container + +Open a Terminal, and - for example - type `bazel build ...` to execute the default build of the repository. + +After you have build the code, create [compilation databases](https://clang.llvm.org/docs/JSONCompilationDatabase.html) via Visual Studio Code [Task](https://code.visualstudio.com/docs/debugtest/tasks): + +- C++: Ctrl + Shift + p -> `Tasks: Run Task` -> `Update compile_commands.json` +- Rust: Ctrl + Shift + p -> `Tasks: Run Task` -> `Update rust-project.json` + +These databases are used by Visual Studio Code to support code navigation and auto-completion with the help of [language servers](https://microsoft.github.io/language-server-protocol/). + +Congratulations, you are now a dev container enthusiast 😊. + ### Bazel's `linux-sandbox` `linux-sandbox` makes use of [Linux user namespaces](https://man7.org/linux/man-pages/man7/user_namespaces.7.html). @@ -77,19 +90,6 @@ probably due to lack of alternatives. > [!NOTE] > If `linux-sandbox` is not needed, do not add this snippet. -### Inside the Container - -Open a Terminal, and - for example - type `bazel build ...` to execute the default build of the repository. - -After you have build the code, create [compilation databases](https://clang.llvm.org/docs/JSONCompilationDatabase.html) via Visual Studio Code [Task](https://code.visualstudio.com/docs/debugtest/tasks): - -- C++: Ctrl + Shift + p -> `Tasks: Run Task` -> `Update compile_commands.json` -- Rust: Ctrl + Shift + p -> `Tasks: Run Task` -> `Update rust-project.json` - -These databases are used by Visual Studio Code to support code navigation and auto-completion with the help of [language servers](https://microsoft.github.io/language-server-protocol/). - -Congratulations, you are now a dev container enthusiast 😊. - ### How to use: codeql The devcontainer codeql installation supports C, C++ and Rust source code analysis. All publicly available From 2ea1001c6f59959e26df886413f429144ea4b7ca Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Thu, 9 Apr 2026 21:19:48 +0000 Subject: [PATCH 2/7] Add QNX setup guide Because QNX support cannot be provided generically, we have to document how to do it. --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/README.md b/README.md index ddceca3..cc28e0e 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,77 @@ codeql database analyze _sca/codeql_data \ --output=_sca/codeql-results.sarif ``` +### Optional: QNX Support in Your Repository + +QNX support cannot be provided generically in this shared devcontainer image. +As discussed in [issue #49](https://github.com/eclipse-score/devcontainer/issues/49#issuecomment-4217458769), it has to be configured per repository. + +The recommended approach is to follow the pattern used in +[`inc_someip_gateway/.devcontainer`](https://github.com/eclipse-score/inc_someip_gateway/tree/main/.devcontainer): + +1. Build a small repository-local Dockerfile based on `ghcr.io/eclipse-score/devcontainer:`. +2. Rename the default `vscode` user to the host username via build arg. +3. Bind-mount the QNX license and credentials into the container. +4. Create missing host files in `initializeCommand` so startup is smooth. + +Use this setup in your repository: + +`.devcontainer/Dockerfile` + +```Dockerfile +FROM ghcr.io/eclipse-score/devcontainer: + +ARG USERNAME=vscode + +# Rename 'vscode' to the host username for QNX-related user expectations. +RUN if [ "$USERNAME" != "vscode" ]; then \ + usermod -l ${USERNAME} vscode \ + && groupmod -n ${USERNAME} vscode \ + && usermod -d /home/${USERNAME} -m ${USERNAME} \ + && ln -s /home/${USERNAME} /home/vscode \ + && echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \ + && chmod 0440 /etc/sudoers.d/${USERNAME}; \ + fi + +USER ${USERNAME} +``` + +`.devcontainer/devcontainer.json` + +```json +{ + "name": "eclipse-s-core", + "build": { + "dockerfile": "Dockerfile", + "args": { + "USERNAME": "${localEnv:USER}" + } + }, + "remoteUser": "${localEnv:USER}", + "mounts": [ + { + "source": "${localEnv:HOME}${localEnv:USERPROFILE}/.qnx/license/licenses", + "target": "/opt/score_qnx/license/licenses", + "type": "bind" + }, + { + "source": "${localEnv:HOME}${localEnv:USERPROFILE}/.netrc", + "target": "/home/${localEnv:USER}/.netrc", + "type": "bind" + } + ], + "initializeCommand": { + "Make sure QNX license exists": "mkdir -p ~/.qnx/license && touch -a ~/.qnx/license/licenses", + "Make sure .netrc exists": "touch -a ~/.netrc" + } +} +``` + +Notes: + +- The mounted license file path inside the container must be `/opt/score_qnx/license/licenses`. +- `.netrc` is a practical way to provide myQNX credentials without committing secrets into the repository. + ## Development > [!NOTE] From c47aa54091812dfde5819017380832a8d4ac9587 Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Thu, 9 Apr 2026 21:32:28 +0000 Subject: [PATCH 3/7] Add dependabot workaround to the readme --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc28e0e..39a2ed8 100644 --- a/README.md +++ b/README.md @@ -38,15 +38,32 @@ From here on, we assume that such a development container setup is installed and Add a file called `.devcontainer/devcontainer.json` to your repository. It should contain the following: +`.devcontainer/devcontainer.json` + ````json { "name": "eclipse-s-core", - "image": "ghcr.io/eclipse-score/devcontainer:" + "build": { + "dockerfile": "Dockerfile" + } } ```` +`.devcontainer/Dockerfile` + +```Dockerfile +# Use Dockerfile to get Dependabot version bumps after new image is released +FROM ghcr.io/eclipse-score/devcontainer: +``` + The `` must be a [valid, published release](https://github.com/eclipse-score/devcontainer/tags). -You can also use `main` as `` to automatically follow the `main` branch, and `latest` to follow release tags - but be aware that this can result in undesired updates. + +> [!NOTE] +> Dependabots devcontainer support does not include devcontainer images so far. +> With the Dockerfile Dependabot will create pull request after a new devcontainer image release is published. + +You can also use `main` as `` to automatically follow the `main` branch, and `latest` to follow release tags - but be aware that this will make it harder to figure out with which container version the code has been build and tested. +You and a colleague might be working with different container versions without knowing, because newer versions of the same tag name are not pulled automatically by Docker. To start using the container, click the **Reopen in Container** button when prompted by Visual Studio Code: From 65abca741cdca9eba6c4351b4eefa12d1e2fd2a6 Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Fri, 10 Apr 2026 08:29:13 +0000 Subject: [PATCH 4/7] consistent notes --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 39a2ed8..d6a74b8 100644 --- a/README.md +++ b/README.md @@ -201,10 +201,9 @@ USER ${USERNAME} } ``` -Notes: - -- The mounted license file path inside the container must be `/opt/score_qnx/license/licenses`. -- `.netrc` is a practical way to provide myQNX credentials without committing secrets into the repository. +> [!NOTE] +> - The mounted license file path inside the container must be `/opt/score_qnx/license/licenses`. +> - `.netrc` is a practical way to provide myQNX credentials without committing secrets into the repository. ## Development From 6e611ff684ab665ec87802d24dc74950757aa6f0 Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Fri, 10 Apr 2026 08:33:04 +0000 Subject: [PATCH 5/7] remove optional for more consisteny --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d6a74b8..77f68af 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ codeql database analyze _sca/codeql_data \ --output=_sca/codeql-results.sarif ``` -### Optional: QNX Support in Your Repository +### QNX Support in Your Repository QNX support cannot be provided generically in this shared devcontainer image. As discussed in [issue #49](https://github.com/eclipse-score/devcontainer/issues/49#issuecomment-4217458769), it has to be configured per repository. From ec590cbeacfb269858a7478226790f4f481ef368 Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Fri, 10 Apr 2026 08:37:54 +0000 Subject: [PATCH 6/7] remove inc_someip_gateway reference --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 77f68af..f40b744 100644 --- a/README.md +++ b/README.md @@ -137,11 +137,11 @@ codeql database analyze _sca/codeql_data \ ### QNX Support in Your Repository -QNX support cannot be provided generically in this shared devcontainer image. -As discussed in [issue #49](https://github.com/eclipse-score/devcontainer/issues/49#issuecomment-4217458769), it has to be configured per repository. +QNX support cannot be provided generically in this shared devcontainer image and has to be configured per repository. +The basic reason is that QNX licenses might be bound to a user name, which is impossible to support for a generic container image. +For more details see [issue #49](https://github.com/eclipse-score/devcontainer/issues/49#issuecomment-4217458769). -The recommended approach is to follow the pattern used in -[`inc_someip_gateway/.devcontainer`](https://github.com/eclipse-score/inc_someip_gateway/tree/main/.devcontainer): +The recommended approach is to follow this pattern: 1. Build a small repository-local Dockerfile based on `ghcr.io/eclipse-score/devcontainer:`. 2. Rename the default `vscode` user to the host username via build arg. From 6a8e7e81a5d1e0234f6ebde112a87c6792181517 Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Fri, 10 Apr 2026 09:11:02 +0000 Subject: [PATCH 7/7] document reason of user renaming --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f40b744..8d79899 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ FROM ghcr.io/eclipse-score/devcontainer: ARG USERNAME=vscode # Rename 'vscode' to the host username for QNX-related user expectations. +# In environments using a license server, the QNX license might be bound to a username. RUN if [ "$USERNAME" != "vscode" ]; then \ usermod -l ${USERNAME} vscode \ && groupmod -n ${USERNAME} vscode \ @@ -202,7 +203,6 @@ USER ${USERNAME} ``` > [!NOTE] -> - The mounted license file path inside the container must be `/opt/score_qnx/license/licenses`. > - `.netrc` is a practical way to provide myQNX credentials without committing secrets into the repository. ## Development