Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 4, 2024

Conversation

rioriost
Copy link
Contributor

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.

With cgroup v2, CID can be read from /proc/self/mountinfo
buchdag
buchdag previously approved these changes Jan 30, 2024
@buchdag buchdag added the type/fix PR for a bug fix label Jan 30, 2024
@buchdag buchdag changed the title Update functions.sh fix: get container ID from /proc/self/mountinfo (for podman) Jan 30, 2024
@buchdag
Copy link
Member

buchdag commented Jan 30, 2024

Hi.

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

@buchdag
Copy link
Member

buchdag commented Feb 10, 2024

friendly ping @rioriost

buchdag
buchdag previously approved these changes May 4, 2024
@buchdag buchdag merged commit c99e656 into nginx-proxy:main May 4, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix PR for a bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants