acme-companion icon indicating copy to clipboard operation
acme-companion copied to clipboard

fix: get container ID from /proc/self/mountinfo (for podman)

Open rioriost opened this issue 1 year ago • 2 comments
trafficstars

With cgroup v2, CID can be read from /proc/self/mountinfo

OCI specification defines that hostname must be set with UTS namespace. http://wking.github.io/opencontainer-runtime-spec/#_hostname

Podman set the hostname of container running in a pod to a name of pod, e.g. 'test-pod', not a container ID, e.g. '1cb364360e42'. Docker API via /tmp/docker.sock linked to /var/run/podman.sock returns error as following. {"cause":"no such container","message":""test-pod" is a pod, not a container: no such container","response":404}

Need to get container ID from /proc/self/mountinfo from the container inside if the container is running in a pod by Podman.

rioriost avatar Jan 28 '24 02:01 rioriost

Hi.

Does neither the /proc/1/cpuset nor /proc/self/cgroup methods work on Podman ?

buchdag avatar Jan 30 '24 07:01 buchdag

friendly ping @rioriost

buchdag avatar Feb 10 '24 18:02 buchdag