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

[docker] fix container ID extraction for RancherOS #2466

Merged
merged 1 commit into from
May 4, 2016

Conversation

hkaj
Copy link
Member

@hkaj hkaj commented May 4, 2016

fixes #2454

Lines in /proc/$PID/cgroup don't have the same format for all system.

  • In CoreOS they look like: 3:cpu,cpuacct:/system.slice/docker-$CONTAINER_ID.scope
  • In RancherOS: 5:cpu,cpuacct:/docker/$USER_DOCKER_CID/docker/$CONTAINER_ID
  • In Ubuntu: 4:cpuacct:/docker/$CONTAINER_ID

To avoid picking the first (wrong) container ID, let's switch from search to re.findall.

@hkaj hkaj added this to the 5.8.0 milestone May 4, 2016
@hkaj hkaj added the bugfix label May 4, 2016
@gmmeyer
Copy link
Contributor

gmmeyer commented May 4, 2016

LGTM 👍

@hkaj hkaj merged commit 8d2bcf6 into master May 4, 2016
@hkaj hkaj deleted the haissam/docker-fix-c_id-extracting branch May 4, 2016 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker_daemon reports 'Couldn't find pid directory' on RancherOS
2 participants