mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
g3doc/docker-in-gvisor: don't require mounting cgroups
Now, containers are started with all mounted cgroups. PiperOrigin-RevId: 613811100
This commit is contained in:
@@ -21,28 +21,17 @@ Since Docker requires root privileges and a full set of capabilities, a gVisor
|
||||
sandbox needs to be started in privileged mode:
|
||||
|
||||
```shell
|
||||
$ docker run --runtime runsc -it --rm --privileged docker-in-gvisor bash
|
||||
$ docker run --runtime runsc -d --rm --privileged --name docker-in-gvisor docker-in-gvisor
|
||||
```
|
||||
|
||||
All following commands have to be executed inside a gVsior sandbox.
|
||||
Now, we can build and run Docker containers.
|
||||
|
||||
For the Docker daemon to operate correctly, the devices cgroup must be mounted
|
||||
using the following commands:
|
||||
Let's enter in the gvisor sandbox and run some docker commands:
|
||||
|
||||
```shell
|
||||
mount -t tmpfs cgroups /sys/fs/cgroup
|
||||
mkdir /sys/fs/cgroup/devices
|
||||
mount -t cgroup -o devices devices /sys/fs/cgroup/devices
|
||||
docker exec -it docker-in-gvisor bash
|
||||
```
|
||||
|
||||
Afterwards, the daemon can be started with the following command:
|
||||
|
||||
```shell
|
||||
/usr/bin/dockerd --bridge=none --iptables=false --ip6tables=false
|
||||
```
|
||||
|
||||
Now, we can build and run Docker containers
|
||||
|
||||
```shell
|
||||
$ mkdir whalesay && cd whalesay
|
||||
$ cat > Dockerfile <<EOF
|
||||
|
||||
Reference in New Issue
Block a user