我有以下目录(在我的主机上):
drwxr-xr-x@ - mnj mnj 15 Dec 21:02 -- mocks/
它属于我(mnj),每个人都应该至少拥有它的读取访问权限。我正在基于以下 docker-compose 服务运行 podman 容器(不带 sudo):
mountebank:
image: jkris/mountebank:latest
hostname: mountebank
volumes:
- ./mocks/:/mountebank
command: >
--configfile=/mountebank/imposters.json.ejs
--allowInjection
该目录mocks
应显示在/mountebank
容器内部。
Mountebank 失败并出现错误:
错误:EACCES:权限被拒绝,打开“/mountebank/imposters.json.ejs”
当我进入容器的外壳时,我在中看到以下内容/
:
bash-4.3# ls -lah
total 0
dr-xr-xr-x 1 root root 38 Dec 16 11:48 .
dr-xr-xr-x 1 root root 38 Dec 16 11:48 ..
drwxr-xr-x 1 root root 4 Feb 28 2022 bin
drwxr-xr-x 5 root root 360 Dec 16 11:48 dev
drwxr-xr-x 1 root root 22 Dec 16 11:48 etc
drwxr-xr-x 1 root root 0 Mar 6 2019 home
drwxr-xr-x 1 root root 72 Feb 28 2022 lib
drwxr-xr-x 1 root root 28 Mar 6 2019 media
drwxr-xr-x 1 root root 0 Mar 6 2019 mnt
drwxr-xr-x 1 root root 168 Dec 15 21:02 mountebank
dr-xr-xr-x 486 nobody nobody 0 Dec 16 11:48 proc
drwxr-xr-x 1 root root 40 Dec 16 11:48 run
drwxr-xr-x 1 root root 792 Mar 6 2019 sbin
drwxr-xr-x 1 root root 0 Mar 6 2019 srv
dr-xr-xr-x 13 nobody nobody 0 Dec 16 11:37 sys
drwxrwxrwt 1 root root 28 Feb 28 2022 tmp
drwxr-xr-x 1 root root 18 Feb 28 2022 usr
drwxr-xr-x 1 root root 6 Feb 28 2022 var
看来mountebank
任何人都应该可读。但是,当我cd mountebank
尝试这样做时ls
,我收到此错误:
ls:无法打开“。”:权限被拒绝
这是为什么?