docker 运行没有权限执行文件解决
docker运行挂载主系统目录,导致无法启动configuration error: open /etc/docker/registry/config.yml: permission denied 提示无权限
提示无权限)
第一步:查看日志
docker logs -t --since 10m containner
显示:
2018-10-09T14:26:56.413262000Z configuration error: open /etc/docker/registry/config.yml: permission denied
2018-10-09T14:26:56.415470000Z Usage:
2018-10-09T14:26:56.415956000Z registry serve [flags]
2018-10-09T14:26:56.416417000Z Flags:
2018-10-09T14:26:56.416905000Z -h, --help=false: help for serve
2018-10-09T14:26:56.418310000Z Additional help topics:
第二步: 解决权限问题
三种方法:
1>docker run -d –privileged=true container
运行是增加**–privileged=true**特权参数
2>关闭SElinux功能
setenforce 0
3>添加selinux规则,改变要挂载的目录的安全性文本
在主机中修改/soft目录的安全性文档
[root@localhost Desktop]# chcon -Rt svirt_sandbox_file_t /soft
[root@ba471da26d07 soft]# ll
total 384264
-rw-r–r--. 1 root root 212046774 Aug 8 10:01 hadoop-2.7.2.tar.gz
-rw-r–r--. 1 root root 181435897 Aug 8 09:23 jdk-8u102-linux-x64.tar.gz
1234567
解决方法来源:
https://blog.csdn.net/rznice/article/details/52170085
出处:http://www.cnblogs.com/Hackerman/