title: On Debian 11 (Bullseye) /proc/self/cgroup inside a docker container does not show docker infos
body: <p>I recently updated from Debian 10 (Buster) to 11 (Bullseye) and since then my Jenkins setup inside Docker is not working anymore, as Jenkins tries to find out if it is running in a docker container by checking <code>/proc/self/cgroup</code>.</p>
  <p>Normally <code>/proc/self/cgroup</code> inside a docker container would look something like this:</p>
  <pre><code>12:rdma:/
  11:perf_event:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  10:freezer:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  9:memory:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  8:cpuset:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  7:devices:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  6:net_cls,net_prio:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  5:hugetlb:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  4:pids:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  3:cpu,cpuacct:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  2:blkio:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  1:name=systemd:/docker/a2ffe0e97ac22657a2a023ad628e9df837c38a03b1ebc904d3f6d644eb1a1a81
  0::/system.slice/containerd.service
  </code></pre>
  <p>but since I updated to Debian 11 it looks pretty small:</p>
  <pre><code>0::/
  </code></pre>
  <p>As Jenkins is not recognizing anymore that it is running inside a docker container itself, it starts other build containers with the wrong arguments.</p>
  <h2>Question</h2>
  <p>The simple question would be: <strong>Is this a bug?</strong></p>
  <p>But the real question might be what am I doing wrong? I cannot find anyone else with this problem, so it might be a misconfiguration or anything similar.</p>
  <p>I reinstalled Docker, removed any configuration and I even tried downgrading Docker to 20.10.6 as this is the last version I know was working under Debian 10, but none of that changed anything.</p>
  <p>I don't have a clue on how to approach this problem any further. It already took me a full day to find out that the problem was not Jenkins itself (nearly got crazy reading Jenkins logs). I am hitting bedrock right now, so any help and any input is really appreciated!</p>
  <hr />
  <h2>Jenkins stuff</h2>
  <p>For those interested in the Jenkins part, here Jenkins checks if it is running inside a container:
  <a href="https://github.com/jenkinsci/docker-workflow-plugin/blob/b174d46226ef1095903f2e789355a3b216b46dda/src/main/java/org/jenkinsci/plugins/docker/workflow/client/DockerClient.java#L347" rel="noreferrer">https://github.com/jenkinsci/docker-workflow-plugin/blob/b174d46226ef1095903f2e789355a3b216b46dda/src/main/java/org/jenkinsci/plugins/docker/workflow/client/DockerClient.java#L347</a></p>
  <p>Jenkins thinking it is not running inside a container will log something like this:</p>
  <pre><code>Jenkins does not seem to be running inside a container
  $ docker run -t -d -u 0:0
  -w /var/jenkins_home/workspace/myrepo_master
  -v /var/jenkins_home/workspace/myrepo_master:/var/jenkins_home/workspace/myrepo_master:rw,z
  -v /var/jenkins_home/workspace/myrepo_master@tmp:/var/jenkins_home/workspace/myrepo_master@tmp:rw,z
  -e ******** ... my-awesome-build-container cat
  </code></pre>
  <p>And thus mounting <code>/var/jenkins_home</code> from the host system, where Jenkins has no access to from inside its container.
  While the log output on Debian 10 (and Ubuntu 20.04) looks something like this:</p>
  <pre><code>Jenkins seems to be running inside container 7814083762a1bed51dec2f468c6ee07c978a0b6377e347c3ed7dc23393feac11
  $ docker run -t -d -u 0:0
  -w /var/jenkins_home/workspace/myrepo_master
  --volumes-from 7814083762a1bed51dec2f468c6ee07c978a0b6377e347c3ed7dc23393feac11
  -e ******** ... my-awesome-build-container cat
  </code></pre>
  <p>and starting the build container with the correct volume using <code>--volumes-from</code>.</p>