提交 fee94069 编写于 作者: F Felix Abecassis

Don't chroot, let nvidia-container-cli handle it instead

Partial revert of d5b66930
上级 517b46d2
......@@ -2,7 +2,7 @@ disable-require = false
#swarm-resource = "DOCKER_RESOURCE_GPU"
[nvidia-container-cli]
#root = "/run/nvidia"
#root = "/run/nvidia/driver"
#path = "/usr/bin/nvidia-container-cli"
environment = []
#debug = "/var/log/nvidia-container-runtime-hook.log"
......
......@@ -2,7 +2,7 @@ disable-require = false
#swarm-resource = "DOCKER_RESOURCE_GPU"
[nvidia-container-cli]
#root = "/run/nvidia"
#root = "/run/nvidia/driver"
#path = "/usr/bin/nvidia-container-cli"
environment = []
#debug = "/var/log/nvidia-container-runtime-hook.log"
......
......@@ -2,7 +2,7 @@ disable-require = false
#swarm-resource = "DOCKER_RESOURCE_GPU"
[nvidia-container-cli]
#root = "/run/nvidia"
#root = "/run/nvidia/driver"
#path = "/usr/bin/nvidia-container-cli"
environment = []
#debug = "/var/log/nvidia-container-runtime-hook.log"
......
......@@ -53,7 +53,6 @@ func capabilityToCLI(cap string) string {
return ""
}
// getCLIPath must be called after the chroot.
func getCLIPath(config CLIConfig) string {
if config.Path != nil {
return *config.Path
......@@ -73,7 +72,6 @@ func getCLIPath(config CLIConfig) string {
}
// getRootfsPath returns an absolute path. We don't need to resolve symlinks for now.
// Must be called *before* the chroot.
func getRootfsPath(config containerConfig) string {
rootfs, err := filepath.Abs(config.Rootfs)
if err != nil {
......@@ -99,11 +97,6 @@ func doPrestart() {
}
rootfs := getRootfsPath(container)
if cli.Root != nil {
if err := syscall.Chroot(*cli.Root); err != nil {
log.Panicf("couldn't chroot to %s: %s", *cli.Root, err)
}
}
args := []string{getCLIPath(cli)}
if cli.Root != nil {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册