Skip to content

Commit

Permalink
chore(README.md): add documentation regarding target user (#386)
Browse files Browse the repository at this point in the history
(cherry picked from commit d14ab3d)
  • Loading branch information
johnstcn authored and mafredri committed Oct 30, 2024
1 parent 0096b04 commit 7756b14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ To explore more examples, tips, and advanced usage, check out the following guid
- [Git Authentication](./docs/git-auth.md)
- [Caching](./docs/caching.md)
- [Custom Certificates](./docs/custom-certificates.md)
- [Users](./docs/users.md)

## Setup Script

Expand Down
9 changes: 9 additions & 0 deletions docs/users.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Root Privileges

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.

## Choosing a target user

Envbuilder will first attempt to switch to the `containerUser` defined `devcontainer.json`.
If this is not specified, it will look up the last `USER` directive from the specified `Dockerfile` or image.
If no alternative user is specified, Envbuilder will fallback to `root`.

0 comments on commit 7756b14

Please sign in to comment.