我需要你的帮助来理解我的问题。
上周我更新了我的Macintosh到Catalina系统,然后更新了Mac版Docker。
自从这些更新之后,我在共享卷上遇到了权限问题。
我可以通过一个小例子进行复现。我只需创建一个简单的docker-compose文件来构建一个nginx容器。 我有一个名为"src/index.php"的PHP文件的文件夹src。
我构建容器并启动它。 然后我进入/app/www/mysrc(共享卷),输入“ls -la”以检查index.php是否正常,结果是:
ls: cannot open directory '.': Operation not permitted
这是一个简单的docker-compose文件: docker-compose.yml:
version: "3"
services:
test-nginx:
restart: always
image: 'nginx:1.17.3'
ports:
- "8082:80"
volumes:
- ./src:/app/www/mysrc
当我构建并启动容器时,出现以下信息:$ docker-compose exec test-nginx sh
# cd /app/www
# ls -la
total 8
drwxr-xr-x 3 root root 4096 Oct 21 07:58 .
drwxr-xr-x 3 root root 4096 Oct 21 07:58 ..
drwxr-xr-x 3 root root 96 Oct 21 07:51 mysrc
# cd mysrc
# ls -la
ls: cannot open directory '.': Operation not permitted
# whoami
root
所以,我的 nginx 服务器挂了,因为 nginx 无法访问源文件。谢谢你的帮助。