0

The title almost says it all:

From within a running docker container, how can I find out if it is running with cgroups 1.0 or with cgroups 2.0?

SamTheEagle
  • 63
  • 1
  • 6

2 Answers2

3

run the cmd

docker info | grep 'Cgroup Version'

it will print the cgroup version use by docker on your host

raphaelauv
  • 670
  • 1
  • 11
  • 22
1

You should be able to check whether cgroup2 is available or not with the command:

grep -c cgroup2 /proc/filesystems

If 1 is returned the cgroups 2.0 are available, but I'm not sure this will be sufficient to conclude that they are also used.

Davide Madrisan
  • 1,969
  • 2
  • 14
  • 22
  • No, this is not sufficient unfortunately: It only shows that cgroup2 is available, not that Docker uses it. Taking Debian Buster as an example (where Docker still uses cgroup V1.0 by default), /proc/filesystems _does_ contain the line "nodev cgroup2" nevertheless. – SamTheEagle Oct 15 '21 at 06:25