美文网首页
11-docker映射目录时报错

11-docker映射目录时报错

作者: Guoyubo | 来源:发表于2019-06-24 18:25 被阅读0次

    参考:https://www.cnblogs.com/performancetest/p/5719420.html
    进容器看映射的目录看到报错:
    ls: cannot open directory .: Permission denied

    解决:

    关闭selinux,有的系统默认就是关的,有的不是


    图片.png

    1
    永久设置:
    cat /etc/selinux/config
    设置SELINUX=disabled后重启机器reboot

    图片.png
    临时设置,重启后失效:setenforce 0
    参考:https://www.jianshu.com/p/01f7436998ae
    或者
    2
    在docker run中加入 --privileged=true 给容器加上特定权限

    相关文章

      网友评论

          本文标题:11-docker映射目录时报错

          本文链接:https://www.haomeiwen.com/subject/artaqctx.html