docker ls: cannot open directory .: Permission denied

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

posted on 2015-05-29 22:15  盐味  阅读(3128)  评论(0编辑  收藏  举报