Skip to content

Commit 7756b14

Browse files
johnstcnmafredri
authored andcommitted
chore(README.md): add documentation regarding target user (#386)
(cherry picked from commit d14ab3d)
1 parent 0096b04 commit 7756b14

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ To explore more examples, tips, and advanced usage, check out the following guid
4848
- [Git Authentication](./docs/git-auth.md)
4949
- [Caching](./docs/caching.md)
5050
- [Custom Certificates](./docs/custom-certificates.md)
51+
- [Users](./docs/users.md)
5152

5253
## Setup Script
5354

docs/users.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Root Privileges
2+
3+
Envbuilder always expects to be run as `root` in its container, as building an image will most likely require root privileges. Once the image is built, Envbuilder will drop root privileges and `exec` `ENVBUILDER_INIT_COMMAND` / `ENVBUILDER_INIT_SCRIPT` as a non-root user.
4+
5+
## Choosing a target user
6+
7+
Envbuilder will first attempt to switch to the `containerUser` defined `devcontainer.json`.
8+
If this is not specified, it will look up the last `USER` directive from the specified `Dockerfile` or image.
9+
If no alternative user is specified, Envbuilder will fallback to `root`.

0 commit comments

Comments
 (0)