From 11c323fbd302ef37230f8c5e612fb05f7f01dd08 Mon Sep 17 00:00:00 2001 From: Zhenfang Wei Date: Sat, 30 Apr 2016 07:37:00 +0200 Subject: [PATCH] Fixed the docker netns detection err on xenial (#15) With ubuntu 16.04 and docker-engine 1.11, the docker netns detection function failed to look for the correct location of task file. This change fixed the issue. Signed-off-by: Zhenfang Wei --- netns_linux.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netns_linux.go b/netns_linux.go index f7bcfac..0f038d1 100644 --- a/netns_linux.go +++ b/netns_linux.go @@ -182,6 +182,8 @@ func getPidForContainer(id string) (int, error) { filepath.Join(cgroupRoot, cgroupThis, "docker", id, "tasks"), // Even more recent docker versions under systemd use docker-.scope/ filepath.Join(cgroupRoot, "system.slice", "docker-"+id+".scope", "tasks"), + // Even more recent docker versions under cgroup/systemd/docker// + filepath.Join(cgroupRoot, "..", "systemd", "docker", id, "tasks"), } var filename string