jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-72443] can not get container id if the Jenkins is running in a podman

Open
#713 3 comments 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin imported-jira-issue priority:blocker resolution:unresolved
Dominant language
Java
Stars
527
Forks
422
Avg merge
10m
Merged PRs (30d)
1

Description

when try to use docker.image(), it will find the container id first. However, the current method getContainerIdIfContainerized() can not parse the container id because the return message of /proc/1/moutninfo is different. Please refer to the following.


cat /proc/1/mountinfo | grep /hostname

1339 1333 0:48 /containers/overlay-containers/4c4d5c5475f78f2b8a98e2894adcc3152ac587ac3c406a5c4eb74cc3f129c03c/userdata/hostname /etc/hostname rw,nosuid,nodev,relatime - tmpfs tmpfs rw,seclabel,size=1609596k,mode=700,uid=1001,gid=1001

 


Reproduction steps



  1. run a docker container in a podman container, on REHL8.

  2. go to the docker conainer

  3. run command: cat /proc/1/mountinfo | grep /hostname

  4. check the string which contains the contianer id.

Expected Results

the current code uses regexp "/containers/([a-z0-9]{64})/hostname" to parse the container id, so it expects /containers/[id]/hostname.


Actual Results

1339 1333 0:48 /containers/overlay-containers/4c4d5c5475f78f2b8a98e2894adcc3152ac587ac3c406a5c4eb74cc3f129c03c/userdata/hostname /etc/hostname rw,nosuid,nodev,relatime - tmpfs tmpfs rw,seclabel,size=1609596k,mode=700,uid=1001,gid=1001

---
Originally reported by westmount, imported from: can not get container id if the Jenkins is running in a podman


  • assignee: naveenboni
  • status: Open
  • priority: Blocker
  • component(s): docker-workflow-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 5
  • imported: 2025-12-07

Raw content of original issue

when try to use docker.image(), it will find the container id first. However, the current method getContainerIdIfContainerized() can not parse the container id because the return message of /proc/1/moutninfo is different. Please refer to the following.


cat /proc/1/mountinfo | grep /hostname

1339 1333 0:48 /containers/overlay-containers/4c4d5c5475f78f2b8a98e2894adcc3152ac587ac3c406a5c4eb74cc3f129c03c/userdata/hostname /etc/hostname rw,nosuid,nodev,relatime - tmpfs tmpfs rw,seclabel,size=1609596k,mode=700,uid=1001,gid=1001

 


Reproduction steps



  1. run a docker container in a podman container, on REHL8.

  2. go to the docker conainer

  3. run command: cat /proc/1/mountinfo | grep /hostname

  4. check the string which contains the contianer id.

Expected Results

the current code uses regexp "/containers/([a-z0-9]{64})/hostname" to parse the container id, so it expects /containers/[id]/hostname.


Actual Results

1339 1333 0:48 /containers/overlay-containers/4c4d5c5475f78f2b8a98e2894adcc3152ac587ac3c406a5c4eb74cc3f129c03c/userdata/hostname /etc/hostname rw,nosuid,nodev,relatime - tmpfs tmpfs rw,seclabel,size=1609596k,mode=700,uid=1001,gid=1001

environment

```
REHL8,

 Jenkins running in podman on REHL8, docker installed in Jenkins image
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.