From d58226c22c86377519feea0daa6a15383968656e Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Wed, 25 Dec 2019 14:36:32 +0000 Subject: [PATCH] Do not check for (host) vsyscall support on the non-Linux systems Fixes #19 --- kernel.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel.go b/kernel.go index 9e25996..b5a8fd1 100644 --- a/kernel.go +++ b/kernel.go @@ -15,6 +15,7 @@ import ( "os/exec" "os/user" "regexp" + "runtime" "strings" "time" @@ -99,6 +100,14 @@ func dockerImagePath(sk config.KernelMask) (path string, err error) { } func vsyscallAvailable() (available bool, err error) { + if runtime.GOOS != "linux" { + // Docker for non-Linux systems is not using the host + // kernel but uses kernel inside a virtual machine, so + // it builds by the Docker team with vsyscall support. + available = true + return + } + buf, err := ioutil.ReadFile("/proc/self/maps") if err != nil { return