moby: [dind] Cannot get cgroups v2 working with rootless container
Hi,
Followed instructions here to setup host - https://docs.docker.com/engine/security/rootless/#limiting-resources
$ uname -a
Linux ubuntu 5.11.0-37-generic #41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
root@ubuntu:~# cat /sys/fs/cgroup/cgroup.controllers
cpuset cpu io memory hugetlb pids rdma
Here is the host docker info:
$ docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Build with BuildKit (Docker Inc., v0.6.3-docker)
scan: Docker Scan (Docker Inc., v0.8.0)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 3
Server Version: 20.10.9
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
**Cgroup Driver: systemd
Cgroup Version: 2**
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc version: v1.0.2-0-g52b36a2
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
cgroupns
Kernel Version: 5.11.0-37-generic
Operating System: Ubuntu 20.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.64GiB
Name: ubuntu
ID: 7IXJ:75XQ:7U7X:QNM7:RSAE:VE3X:IWOU:OWEX:GHUR:MF2E:4YEZ:GXE2
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Rootless info
$ docker run --rm -it --privileged --name dind-rootless -e DOCKER_TLS_CERTDIR="" -p 2375:2375 docker:dind-rootless --tls=false
$ export DOCKER_HOST=127.0.0.1:2375
$ docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Build with BuildKit (Docker Inc., v0.6.3-docker)
scan: Docker Scan (Docker Inc., v0.8.0)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 20.10.9
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: false
userxattr: true
Logging Driver: json-file
**Cgroup Driver: none**
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
Default Runtime: runc
Init Binary: docker-init
containerd version: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc version: v1.0.2-0-g52b36a2d
init version: de40ad0
Security Options:
seccomp
Profile: default
rootless
cgroupns
Kernel Version: 5.11.0-37-generic
Operating System: Alpine Linux v3.14
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.64GiB
Name: 3413947f33b5
ID: QDAZ:HRE3:2E4A:2N6R:LOVA:FSQ3:DCM3:ZXPH:G3QN:7OUG:7QEM:IQU5
Docker Root Dir: /home/rootless/.local/share/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
WARNING: API is accessible on http://0.0.0.0:2375 without encryption.
Access to the remote API is equivalent to root access on the host. Refer
to the 'Docker daemon attack surface' section in the documentation for
more information: https://docs.docker.com/go/attack-surface/
**WARNING: Running in rootless-mode without cgroups. Systemd is required to enable cgroups in rootless-mode.**
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 31 (13 by maintainers)
@dg424 Git history should be your friend; https://github.com/docker-library/docker/commits/master/ Looks like https://github.com/docker-library/docker/commit/03ecb33955c16b34b7d52c7563f05c736f159875 added the 27.5.1 image
And the entrypoints at that commit are;
Having a Docker container with running/functioning
systemdis definitely going to be a challenge, in my experience. 😕