You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
*`sudo sh -c "echo 1 > /proc/sys/kernel/unprivileged_userns_clone"` is required
25
+
Using Ubuntu kernel is recommended.
26
+
27
+
#### Ubuntu
28
+
* No preparation is needed.
29
+
*`overlay2` is enabled by default ([Ubuntu-specific kernel patch](https://kernel.ubuntu.com/git/ubuntu/ubuntu-bionic.git/commit/fs/overlayfs?id=3b7da90f28fe1ed4b79ef2d994c81efbc58f1144)).
30
+
* Known to work on Ubuntu 16.04 and 18.04.
31
+
32
+
#### Debian GNU/Linux
33
+
* Add `kernel.unprivileged_userns_clone=1` to `/etc/sysctl.conf` (or `/etc/sysctl.d`) and run `sudo sysctl -p`
34
+
* To use `overlay2` storage driver (recommended), run `sudo modprobe overlay permit_mounts_in_userns=1` ([Debian-specific kernel patch, introduced in Debian 10](https://salsa.debian.org/kernel-team/linux/blob/283390e7feb21b47779b48e0c8eb0cc409d2c815/debian/patches/debian/overlayfs-permit-mounts-in-userns.patch)). Put the configuration to `/etc/modprobe.d` for persistence.
35
+
* Known to work on Debian 9 and 10. `overlay2` is only supported since Debian 10 and needs `modprobe` configuration described above.
28
36
29
37
#### Arch Linux
30
-
*`sudo sh -c "echo 1 > /proc/sys/kernel/unprivileged_userns_clone"` is required
38
+
*Add `kernel.unprivileged_userns_clone=1` to `/etc/sysctl.conf` (or `/etc/sysctl.d`) and run `sudo sysctl -p`
31
39
32
40
#### openSUSE
33
41
*`sudo modprobe ip_tables iptable_mangle iptable_nat iptable_filter` is required. (This is likely to be required on other distros as well)
42
+
* Known to work on openSUSE 15.
43
+
44
+
#### Fedora 31 and later
45
+
* Run `sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"` and reboot.
46
+
47
+
#### Fedora 30
48
+
* No preparation is needed
49
+
50
+
#### RHEL/CentOS 8
51
+
* No preparation is needed
34
52
35
53
#### RHEL/CentOS 7
36
-
*`sudo sh -c "echo 28633 > /proc/sys/user/max_user_namespaces"` is required
37
-
*[COPR package `vbatts/shadow-utils-newxidmap`](https://copr.fedorainfracloud.org/coprs/vbatts/shadow-utils-newxidmap/) needs to be installed
54
+
* Add `user.max_user_namespaces=28633` to `/etc/sysctl.conf` (or `/etc/sysctl.d`) and run `sudo sysctl -p`
55
+
*`systemctl --user` does not work by default. Run the daemon directly without systemd: `dockerd-rootless.sh --experimental --storage-driver vfs`
56
+
* Known to work on RHEL/CentOS 7.7. Older releases require extra configuration steps.
57
+
* RHEL/CentOS 7.6 and older releases require [COPR package `vbatts/shadow-utils-newxidmap`](https://copr.fedorainfracloud.org/coprs/vbatts/shadow-utils-newxidmap/) to be installed.
58
+
* RHEL/CentOS 7.5 and older releases require running `sudo grubby --update-kernel=ALL --args="user_namespace.enable=1"` and reboot.
38
59
39
-
## Restrictions
60
+
## Known limitations
40
61
41
-
* Only `vfs` graphdriver is supported. However, on [Ubuntu](http://kernel.ubuntu.com/git/ubuntu/ubuntu-artful.git/commit/fs/overlayfs?h=Ubuntu-4.13.0-25.29&id=0a414bdc3d01f3b61ed86cfe3ce8b63a9240eba7) and a few distros, `overlay2` and `overlay` are also supported.
62
+
* Only `vfs` graphdriver is supported. However, on Ubuntu and Debian 10, `overlay2` and `overlay` are also supported.
42
63
* Following features are not supported:
43
64
* Cgroups (including `docker top`, which depends on the cgroups device controller)
44
65
* Apparmor
45
66
* Checkpoint
46
67
* Overlay network
47
68
* Exposing SCTP ports
48
-
* To expose a TCP/UDP port, the host port number needs to be set to >= 1024.
69
+
* To use `ping` command, see [Routing ping packets](#routing-ping-packets)
70
+
* To expose privileged TCP/UDP ports (< 1024), see [Exposing privileged ports](#exposing-privileged-ports)
71
+
72
+
## Install
73
+
74
+
The installation script is available at https://get.docker.com/rootless .
75
+
76
+
```console
77
+
$ curl -fsSL https://get.docker.com/rootless | sh
78
+
```
79
+
80
+
Make sure to run the script as a non-root user.
81
+
82
+
The script will show the environment variables that are needed to be set:
83
+
84
+
```console
85
+
$ curl -fsSL https://get.docker.com/rootless | sh
86
+
...
87
+
# Docker binaries are installed in /home/penguin/bin
88
+
# WARN: dockerd is not in your current PATH or pointing to /home/penguin/bin/dockerd
89
+
# Make sure the following environment variables are set (or add them to ~/.bashrc):
To install the binaries manually without using the installer, extract `docker-rootless-extras-<version>.tar.gz` along with `docker-<version>.tar.gz`: https://download.docker.com/linux/static/stable/x86_64/
49
102
50
103
## Usage
51
104
52
105
### Daemon
53
106
54
-
You need to run `dockerd-rootless.sh` instead of `dockerd`.
107
+
Use `systemctl --user` to manage the lifecycle of the daemon:
108
+
```console
109
+
$ systemctl --user start docker
110
+
```
111
+
112
+
To launch the daemon on system startup, enable systemd lingering:
113
+
```console
114
+
$ sudo loginctl enable-linger $(whoami)
115
+
```
55
116
117
+
To run the daemon directly without systemd, you need to run `dockerd-rootless.sh` instead of `dockerd`:
To run Rootless Docker inside "rootful" Docker, use `docker:<version>-dind-rootless` image instead of `docker:<version>-dind` image.
146
+
147
+
```console
148
+
$ docker run -d --name dind-rootless --privileged docker:19.03-dind-rootless --experimental
149
+
```
150
+
151
+
`docker:<version>-dind-rootless` image runs as a non-root user (UID 1000).
152
+
However, `--privileged` is required for disabling seccomp, AppArmor, and mount masks.
153
+
78
154
### Expose Docker API socket via TCP
79
155
80
156
To expose the Docker API socket via TCP, you need to launch `dockerd-rootless.sh` with `DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="-p 0.0.0.0:2376:2376/tcp"`.
Or add `net.ipv4.ip_unprivileged_port_start=0` to `/etc/sysctl.conf` (or `/etc/sysctl.d`) and run `sudo sysctl -p`.
178
+
179
+
### Limiting resources
180
+
181
+
Currently rootless mode ignores cgroup-related `docker run` flags such as `--cpus` and `memory`.
182
+
However, traditional `ulimit` and [`cpulimit`](https://github.com/opsengine/cpulimit) can be still used, though it works in process-granularity rather than container-granularity.
183
+
97
184
### Changing network stack
98
185
99
186
`dockerd-rootless.sh` uses [slirp4netns](https://github.com/rootless-containers/slirp4netns) (if installed) or [VPNKit](https://github.com/moby/vpnkit) as the network stack by default.
0 commit comments