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 <estesp@linux.vnet.ibm.com> (github: estesp)
This commit is contained in:
parent
8ad8d40744
commit
1e24fe814d
8
main.go
8
main.go
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
|
@ -93,6 +94,13 @@ func main() {
|
||||||
// notified of the exit with the correct exit status.
|
// notified of the exit with the correct exit status.
|
||||||
os.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 {
|
if err := app.Run(os.Args); err != nil {
|
||||||
logrus.Fatal(err)
|
logrus.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue