Skip to content

Commit 6b566d8

Browse files
committed
Unify devcontainers
Linux / WSL and Docker on Windows use different scripting languages and this shows in the initializeCommand. With this solution the same devcontainer.json file can be used on all platforms, which reduces maintenance costs.
1 parent acb8639 commit 6b566d8

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

.devcontainer/alt_container_docker_on_windows/devcontainer.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"name": "eclipse-s-core",
33
"image": "ghcr.io/eclipse-score/devcontainer:latest",
4-
"initializeCommand": "mkdir -p ${localEnv:HOME}/.cache/bazel"
4+
"initializeCommand": [
5+
".devcontainer/initialize_command",
6+
"${localEnv:HOME}"
7+
]
58
}

.devcontainer/initialize_command

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
# Create Bazel cache directory if it doesn't exist
5+
home="$1"
6+
mkdir -p "$home/.cache/bazel"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
REM Create Bazel cache directory if it doesn't exist
2+
3+
set home="%1"
4+
IF not exist "%home%\\.cache\\bazel" ( mkdir "%home%\\.cache\\bazel" )

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ Camera App ──► [Video Frame] ──┬──► Display App
8585
> This repository offers a [DevContainer](https://containers.dev/).
8686
> For setting this up and enabling code completion read [eclipse-score/devcontainer/README.md#inside-the-container](https://github.com/eclipse-score/devcontainer/blob/main/README.md#inside-the-container).
8787
88-
>**Note**:
89-
> If you are using Docker on Windows **without `WSL2`** in between, you have to select the alternative container `eclipse-s-core-docker-on-windows`.
90-
9188
### Building the Project
9289

9390
```bash
@@ -141,4 +138,4 @@ We welcome contributions! See our [Contributing Guide](CONTRIBUTING.md) for deta
141138

142139
---
143140

144-
**Note**: This is an open-source project under the Eclipse Foundation. It implements automotive-grade communication middleware suitable for safety-critical applications.
141+
**Note**: This is an open-source project under the Eclipse Foundation. It implements automotive-grade communication middleware suitable for safety-critical applications.

0 commit comments

Comments
 (0)