Permission denied on accessing host directory in docker -
in short: trying mount host directory in docker, can not access within container, if access permissions good.
the details:
i doing
sudo docker run -i -v /data1/downloads:/downloads ubuntu bash and
ls -al it gives me:
total 8892 drwxr-xr-x. 23 root root 4096 jun 18 14:34 . drwxr-xr-x. 23 root root 4096 jun 18 14:34 .. -rwxr-xr-x. 1 root root 0 jun 18 14:34 .dockerenv -rwx------. 1 root root 9014486 jun 17 22:09 .dockerinit drwxrwxr-x. 18 1000 1000 12288 jun 16 11:40 downloads drwxr-xr-x. 2 root root 4096 jan 29 18:10 bin drwxr-xr-x. 2 root root 4096 apr 19 2012 boot drwxr-xr-x. 4 root root 340 jun 18 14:34 dev drwxr-xr-x. 56 root root 4096 jun 18 14:34 etc drwxr-xr-x. 2 root root 4096 apr 19 2012 home and lot more lines (i think relevant portion).
if do
cd /downloads ls the result is
ls: cannot open directory .: permission denied the host fedora 20, docker 1.0.0 , go1.2.2.
any ideas going wrong?
it selinux issue.
you can temporarily issue
su -c "setenforce 0" on host access or else add together selinux rule running
chcon -rt svirt_sandbox_file_t /path/to/volume directory file-permissions docker mount permission-denied
No comments:
Post a Comment