在docker集装箱中无法访问装入的卷

我从docker下载最新的节点映像,并尝试使用以下命令运行一个容器:

$ sudo docker run -it -v $(pwd)/app:/home/node/app --name node node /bin/bash 

然后创build容器,我进入/ home / node / app目录。 我尝试了'ls'命令并得到'权限拒绝'。

我在网上search,有人build议改变主机的应用程序/主机到1000.但它不工作。

以下是我认为可能有用的一些信息:

 $ id //at the host uid=1000(qwang) gid=1000(qwang) groups=1000(qwang),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 $ id //in the container 'node' uid=0(root) gid=0(root) groups=0(root) $ id node //in the container 'node' uid=1000(node) gid=1000(node) groups=1000(node) $ ls -al //pwd => /home/node drwxr-xr-x. 3 node node 69 Jul 19 13:51 . drwxr-xr-x. 3 root root 18 Jul 8 04:16 .. -rw-r--r--. 1 node node 220 Nov 5 2016 .bash_logout -rw-r--r--. 1 node node 3515 Nov 5 2016 .bashrc -rw-r--r--. 1 node node 675 Nov 5 2016 .profile drwxrwxr-x. 2 node node 4096 Jul 19 13:50 app