执行docker run

时间:2017-04-03 13:43:08

标签: docker

我正在尝试以root用户身份运行docker run命令。但是我收到了与特权相关的错误。

任何人都能引导我朝着正确的方向前进,我需要考虑解决这个问题吗?这让我的团队中的一些人感到难过。我们知道它绝对不是图像,因为我们可以在其他盒子上以及在本地运行图像而没有任何问题。

感谢

docker run -it -p 8091:8081 999999999.dkr.ecr.ap-southeast-2.amazonaws.com/999999999.dkr.ecr.ap-southeast-2.amazonaws.com/node-xref-api-v2
panic: standard_init_linux.go:178: exec user process caused "permission denied" [recovered]
    panic: standard_init_linux.go:178: exec user process caused "permission denied"

goroutine 1 [running, locked to thread]:
panic(0x6f3000, 0xc42012ee70)
    /usr/lib/golang/src/runtime/panic.go:500 +0x1a1
github.com/urfave/cli.HandleAction.func1(0xc42007f748)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/urfave/cli/app.go:478 +0x247
panic(0x6f3000, 0xc42012ee70)
    /usr/lib/golang/src/runtime/panic.go:458 +0x243
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0xc42007f198, 0xc42001e0b0, 0xc42007f238)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0x18f
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0xc42004e8c0, 0xaac9c0, 0xc42012ee70)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x353
main.glob..func8(0xc420082780, 0x0, 0x0)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/main_unix.go:26 +0x66
reflect.Value.call(0x6ddd80, 0x769ce8, 0x13, 0x73c1c9, 0x4, 0xc42007f708, 0x1, 0x1, 0x4d17a8, 0x732020, ...)
    /usr/lib/golang/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0x6ddd80, 0x769ce8, 0x13, 0xc42007f708, 0x1, 0x1, 0xac2700, 0xc42007f6e8, 0x4da786)
    /usr/lib/golang/src/reflect/value.go:302 +0xa4
github.com/urfave/cli.HandleAction(0x6ddd80, 0x769ce8, 0xc420082780, 0x0, 0x0)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/urfave/cli/app.go:487 +0x1e0
github.com/urfave/cli.Command.Run(0x73c395, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74d9d9, 0x51, 0x0, ...)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/urfave/cli/command.go:191 +0xc3b
github.com/urfave/cli.(*App).Run(0xc4200c6000, 0xc42000c120, 0x2, 0x2, 0x0, 0x0)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/urfave/cli/app.go:240 +0x611
main.main()
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/main.go:137 +0xbd6
[root@ip-10-140-1-10 ~]# ^C
[root@ip-10-140-1-10 ~]# sudo docker run -it -p 8091:8081 231827969312.dkr.ecr.ap-southeast-2.amazonaws.com/231827969312.dkr.ecr.ap-southeast-2.amazonaws.com/node-xref-api-v2
panic: standard_init_linux.go:178: exec user process caused "permission denied" [recovered]
    panic: standard_init_linux.go:178: exec user process caused "permission denied"

goroutine 1 [running, locked to thread]:
panic(0x6f3000, 0xc42011ce70)
    /usr/lib/golang/src/runtime/panic.go:500 +0x1a1
github.com/urfave/cli.HandleAction.func1(0xc42007f748)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/urfave/cli/app.go:478 +0x247
panic(0x6f3000, 0xc42011ce70)
    /usr/lib/golang/src/runtime/panic.go:458 +0x243
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0xc42007f198, 0xc42001e0c8, 0xc42007f238)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0x18f
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0xc42004f590, 0xaac9c0, 0xc42011ce70)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x353
main.glob..func8(0xc420082a00, 0x0, 0x0)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/main_unix.go:26 +0x66
reflect.Value.call(0x6ddd80, 0x769ce8, 0x13, 0x73c1c9, 0x4, 0xc42007f708, 0x1, 0x1, 0x4d17a8, 0x732020, ...)
    /usr/lib/golang/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0x6ddd80, 0x769ce8, 0x13, 0xc42007f708, 0x1, 0x1, 0xac2700, 0xc42007f6e8, 0x4da786)
    /usr/lib/golang/src/reflect/value.go:302 +0xa4
github.com/urfave/cli.HandleAction(0x6ddd80, 0x769ce8, 0xc420082a00, 0x0, 0x0)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/urfave/cli/app.go:487 +0x1e0
github.com/urfave/cli.Command.Run(0x73c395, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74d9d9, 0x51, 0x0, ...)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/urfave/cli/command.go:191 +0xc3b
github.com/urfave/cli.(*App).Run(0xc4200a0000, 0xc42000c120, 0x2, 0x2, 0x0, 0x0)
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/Godeps/_workspace/src/github.com/urfave/cli/app.go:240 +0x611
main.main()
    /builddir/build/BUILD/docker-96d83a5ff6ec0eb9bb7b45192c3048fd3aef5e21/runc-81b254244390bc636b20c87c34a3d9e1a8645069/main.go:137 +0xbd6

2 个答案:

答案 0 :(得分:5)

在CentOS上,当我的" / var"安装没有执行权限。

如果可能,请尝试使用exec权限重新安装它:

 mount /var/ -o remount,exec

并重新启动Docker引擎。

systemctl restart docker.service

如果这样做,则必须调整fstab,然后删除noexec

答案 1 :(得分:0)

感谢您的帮助。但我在这里找到了答案

https://bugzilla.redhat.com/show_bug.cgi?id=1358819

我通过将selinux设置为许可模式暂时修复了它

inside /etc/selinux/config

SELINUX=permissive