Skip to content

Commit 700e882

Browse files
lurtzopajonk
andauthored
Document state of linux-sandbox in the container (#33)
* Document state of linux-sandbox in the container linux-sandbox does not work by default and is by some expected to work. * fix typo --------- Co-authored-by: Oliver Pajonk <oliver.pajonk@elektrobit.com>
1 parent 0b4bc06 commit 700e882

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Modifying the content of the container is explained in the [Development](#develo
1010

1111
## Usage
1212

13-
> **NOTE:** There are several development environments which support development containers; most notably [Visual Studio Code](https://code.visualstudio.com), but also [IntelliJ IDEA](https://www.jetbrains.com/idea) and others.
13+
> [!NOTE]
14+
> There are several development environments which support development containers; most notably [Visual Studio Code](https://code.visualstudio.com), but also [IntelliJ IDEA](https://www.jetbrains.com/idea) and others.
1415
> See [here](https://containers.dev/supporting) for a more complete list.
1516
> In the following, we assume that [Visual Studio Code](https://code.visualstudio.com) and its Dev Containers extension is used.
1617
The [Dev Containers extension homepage](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) has a description how to get up to speed on Windows, macOS and Linux operating systems.
@@ -43,6 +44,23 @@ Afterwards, Visual Studio Code should show this in the lower left corner of your
4344

4445
![Dev container success](resources/devcontainer_success.png)
4546

47+
### Bazel's `linux-sandbox`
48+
49+
`linux-sandbox` makes use of [Linux user namespaces](https://man7.org/linux/man-pages/man7/user_namespaces.7.html).
50+
These only work for `linux-sandbox` as expected, if the following snippet is added to the `.devcontainer/devcontainer.json`:
51+
52+
```json
53+
"runArgs": [
54+
"--privileged"
55+
]
56+
```
57+
58+
In this case using `--privileged` is [recommended by Bazel](https://bazel.build/docs/sandboxing#sandboxing-strategies),
59+
probably due to lack of alternatives.
60+
61+
> [!NOTE]
62+
> If `linux-sandbox` is not needed, do not add this snippet.
63+
4664
### Inside the Container
4765

4866
Open a Terminal, and - for example - type `bazel build ...` to execute the default build of the repository.
@@ -58,7 +76,8 @@ Congratulations, you are now a dev container enthusiast 😊.
5876

5977
## Development
6078

61-
> **NOTE:** This is about the development *of the DevContainer*, not about development of Eclipse S-CORE *using* the DevContainer.
79+
> [!NOTE]
80+
> This is about the development *of the DevContainer*, not about development of Eclipse S-CORE *using* the DevContainer.
6281
6382
The [Eclipse S-CORE](https://github.com/eclipse-score) development container is developed using - a development container!
6483
That means, the usage is similarly simple:

0 commit comments

Comments
 (0)