docker ls: cannot open directory .: Permission denied


down vote

From access.redhat.com:Sharing_Data_Across_Containers:

" Host volume settings are not portable, since they are host-dependent and might not work on any other machine. For this reason, there is no Dockerfile equivalent for mounting host directories to the container. Also, be aware that the host system has no knowledge of container SELinux policy. Therefore, if SELinux policy is enforced, the mounted host directory is not writable to the container, regardless of the rw setting. Currently, you can work around this by assigning the proper SELinux policy type to the host directory":

~]# chcon -Rt svirt_sandbox_file_t host_dir.

Where host_dir is a path to the directory on host system that is mounted to the container.

It‘s seems to be only a workaround but i tried and it works

时间: 2024-10-12 16:11:20

docker ls: cannot open directory .: Permission denied的相关文章

centos:解决docker容器内挂载目录无权限 ls: cannot open directory .: Permission denied

docker运行一个容器后,将主机中当前目录下的文件夹挂载到容器的文件夹后 进入到docker容器内对应的挂载目录中,运行命令ls后提示: ls: cannot open directory .: Permission denied 解决: 在docker run一个容器时,加上 --privileged=true 给容器加特权即可. 原文地址:https://www.cnblogs.com/UniqueColor/p/9318815.html

ls: cannot open directory .: Permission denied

问题:ls: cannot open directory .: Permission denied 解决:说明当前用户没有执行该命令的方法,需要命令前加sudo 原文地址:https://www.cnblogs.com/saifei1125/p/12129307.html

Docker启动时提示Get Permission Denied while trying to connect解决方法

环境描述 vmware15虚拟机安装centos7.4 64位系统,docker版本19.03.2 问题描述 安装完docker后,执行docker相关命令 docker run ubuntu:15.10 /bin/echo "Hello world" 出现如下提示: docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.so

docker使用entrypoint执行时报permission denied错误

在Dockerfile中使用指令ENTRYPOINT来执行项目下entrypoint.shshell文件,如下: ENTRYPOINT ["./entrypoint.sh"] 时报错提示: Exec: "./entrypoint.sh": permission denied 很明显问题在于用户没有文件的执行权限. 解决方法有两种: 赋予shell文件可执行权限 RUN chmod +x entrypoint.sh 将sh作为ENTRYPOINT数组的第一个参数(推荐

Zookeeper启动Permission denied

Zookeeper 查询状态,出现如下问题: JMX enabled by default Using config: /usr/zookeeper/zookeeper-3.4.5/bin/../conf/zoo.cfg mkdir: cannot create directory `.': Permission denied Mode: leader 而且运行 zkServer.sh start 同样出现如下问题:? JMX enabled by default Using config: /

Docker挂载主机目录Docker访问出现Permission denied的解决办法

Docker挂载主机目录,访问相应的文件出现Premission denied的权限访问问题, [[email protected] soft]# docker images REPOSITORY                 TAG                 IMAGE ID                  CREATED SIZE docker.io/centos            7.2.1511           686672a1d0cc               5

用root帐号切换其他帐号提示 su: warning: cannot change directory to /home/oracle: Permission denied

用root帐号切换其他帐号提示: 出错原因: 基本上是根目录或者是/home/oracle目录权限的问题 解决办法: 更改根目录权限为755,并保证对应用户主目录的所属用户和所属组一致和用户名一致. 示例: --本篇文章转自http://blog.csdn.net/jack161641/article/details/7090490 用root帐号切换其他帐号提示 su: warning: cannot change directory to /home/oracle: Permission d

输入docker ps 报错信息处理Get http:///var/run/docker.sock/v1.19/containers/json: dial unix /var/run/docker.sock: permission denied.

完整错误信息 Get http:///var/run/docker.sock/v1.19/containers/json: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS? 原因: 1.未使用root用户进行操作 2.未让docker以daemon方式运行/bin/bash 解决方案: 1.没有使用root 在控制台上切

Docker使用-v挂载主机目录到容器后出现Permission denied

1. 在挂载主机目录的到容器后,操作挂载的目录出现权限问题: # 将主机上的/data/share/master目录挂载到容器的/opt/share目录docker run -it --name=master --hostname=master -v /data/share/master:/opt/share centos-hadoop /bin/bash [[email protected] share]# pwd #进入挂载目录 /opt/share [[email protected] s