-
Bug
-
Resolution: Unresolved
-
Blocker
-
None
-
RHEL9, Rocky9
Running Jenkins in rke with RHEL9 nodes, with cgroupv2, the docker plugin gets the wrong containerId from /proc/1/selfmount. Rke creates a "pause" container for each pod, and the jenkins-agent container has the containerId of the pause container in /proc/1/selfmount: https://github.com/jenkinsci/docker-workflow-plugin/blob/master/src/main/java/org/jenkinsci/plugins/docker/workflow/client/DockerClient.java#L364 and https://github.com/jenkinsci/docker-workflow-plugin/blob/master/src/main/java/org/jenkinsci/plugins/docker/workflow/client/DockerClient.java#L342 - this hostname mount comes from the pause container and not the jenkins container.
The way the plugin has to get the containerId is unreliable for cgroupv2
This means that the plugin can't find the volumes used by the jenkins agent container, and will fail to mount them: https://github.com/jenkinsci/docker-workflow-plugin/blob/master/src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java#L188-L190 . Because of these two lines, I can't even pass the flag "--volumes-from" to the docker args when running the instruction <image>.inside(dockerArgs), because the plugin tries to mount the workspace path from the host, which does not make sense since the workspace only exists in the jenkins container