From 1e24fe814d5868ce34660d850c18d02e42a2d573 Mon Sep 17 00:00:00 2001 From: Phil Estes Date: Wed, 24 Jun 2015 11:14:46 -0700 Subject: [PATCH] Allow runc to be executed as a relative path This allows "./runc .." instead of adding it to $PATH location Docker-DCO-1.1-Signed-off-by: Phil Estes (github: estesp) --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index 42517e12..e125fde7 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "os" + "path/filepath" "runtime" "github.com/Sirupsen/logrus" @@ -93,6 +94,13 @@ func main() { // notified of the exit with the correct exit status. os.Exit(status) } + + //allow for relative path for the runC binary + if absPath, err := filepath.Abs(os.Args[0]); err != nil { + logrus.Fatal("Cannot convert runc path to absolute: %v", err) + } else { + os.Args[0] = absPath + } if err := app.Run(os.Args); err != nil { logrus.Fatal(err) }