Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions content/manuals/engine/security/rootless/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ with `userns-remap` mode, the daemon itself is running with root privileges,
whereas in rootless mode, both the daemon and the container are running without
root privileges.

The two modes also differ in how they map container UIDs and GIDs to the host:

- In `userns-remap` mode, container UID `0` is mapped to the first subordinate
UID listed in `/etc/subuid` for the remap user, and container UID `n` is
mapped to `subuid + n`.
- In rootless mode, container UID `0` is mapped to the host UID of the user
running rootless Docker (the result of `id -u`); container UID `n` (for
`n >= 1`) is mapped to `subuid + (n - 1)`.

GIDs follow the same rules using `/etc/subgid`.

This difference matters when setting file permissions on bind-mounted
directories: in rootless mode, files owned by your host user appear as owned
by `root` inside the container.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes should be a subpage to avoid inflating the amount of the contents in a single page

Rootless mode does not use binaries with `SETUID` bits or file capabilities,
except `newuidmap` and `newgidmap`, which are needed to allow multiple
UIDs/GIDs to be used in the user namespace.
Expand Down