我正在尝试使用docker容器overlay 。
我正在启动docker守护进程: docker daemon -s overlay
docker run --rm hello-world命令失败:
panic: standard_init_linux.go:175: exec user process caused "permission denied" [recovered] panic: standard_init_linux.go:175: exec user process caused "permission denied" goroutine 1 [running, locked to thread]: panic(0x7e9de0, 0xc82011f110) /usr/local/go/src/runtime/panic.go:481 +0x3e6 github.com/urfave/cli.HandleAction.func1(0xc8200f32e8) /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:478 +0x38e panic(0x7e9de0, 0xc82011f110) /usr/local/go/src/runtime/panic.go:443 +0x4e9 github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0xc8200f2bf8, 0xc82001a0c8, 0xc8200f2d08) /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0x136 github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0xc820059630, 0x7fb8ccc34728, 0xc82011f110) /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x5b1 main.glob.func8(0xc820076a00, 0x0, 0x0) /go/src/github.com/opencontainers/runc/main_unix.go:26 +0x68 reflect.Value.call(0x74e5e0, 0x8ffda0, 0x13, 0x846308, 0x4, 0xc8200f3268, 0x1, 0x1, 0x0, 0x0, ...) /usr/local/go/src/reflect/value.go:435 +0x120d reflect.Value.Call(0x74e5e0, 0x8ffda0, 0x13, 0xc8200f3268, 0x1, 0x1, 0x0, 0x0, 0x0) /usr/local/go/src/reflect/value.go:303 +0xb1 github.com/urfave/cli.HandleAction(0x74e5e0, 0x8ffda0, 0xc820076a00, 0x0, 0x0) /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:487 +0x2ee github.com/urfave/cli.Command.Run(0x8491b8, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8df0e0, 0x51, 0x0, ...) /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/command.go:191 +0xfec github.com/urfave/cli.(*App).Run(0xc820001800, 0xc82000a100, 0x2, 0x2, 0x0, 0x0) /go/src/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/urfave/cli/app.go:240 +0xaa4 main.main() /go/src/github.com/opencontainers/runc/main.go:137 +0xe24
如果我使用默认的devicemapper驱动程序,它没有问题。
当/ var用noexec挂载时,问题就在发生。 当我用mount /var/ -o remount,exec重新启动并重新启动docker守护进程时,一切都开始按预期工作。
您还需要编辑/ etc / fstab并删除noexec的var。
另外可以使用不同的文件夹(例如docker daemon -s overlay -g /new_path/docker ),当使用exec选项安装fs时,还需要使用semanage fcontext和restorecon更改该文件夹的SELinux策略。