我有以下设置:
这是/etc/exports
中的相关行:
/Users/stephenrasku/w/Edge-Agent -alldirs -mapall=501:20 edgeos-dev
我有以下Makefile
:
build:
ls -l
ls -l foo*
当我在NFS挂载的i386
容器中运行它时,它将失败。我正在运行VMware Fusion:
$ docker run --rm -t -v /home/stephen/some-nfs-mount:/home/edge registry.gear.ge.com/predix_edge/edge-agent-i386 "cd tmp && make"
Setting uid/gid to 501 501
ls -l
total 4
-rw-r--r-- 1 builduser builduser 26 Sep 25 17:58 Makefile
-rw-r--r-- 1 builduser builduser 0 Sep 25 17:58 bart
-rw-r--r-- 1 builduser builduser 0 Sep 25 17:58 fool
ls -l foo*
ls: cannot access 'foo*': No such file or directory
Makefile:2: recipe for target 'build' failed
make: *** [build] Error 2
如果我将存储库克隆到本机文件系统并将其绑定安装到容器中,则i386
容器将起作用:
$ docker run --rm -t -v /home/stephen/this-directory-is-not-nfs:/home/edge registry.gear.ge.com/predix_edge/edge-agent-i386 "cd tmp && make"
Setting uid/gid to 501 501
ls -l
total 8
-rw-rw-r-- 1 builduser builduser 971 Sep 26 14:21 Dockerfile-i386
-rw-rw-r-- 1 builduser builduser 26 Sep 26 15:06 Makefile
-rw-rw-r-- 1 builduser builduser 0 Sep 26 14:21 bart
-rw-rw-r-- 1 builduser builduser 0 Sep 26 14:21 fool
ls -l foo*
-rw-rw-r-- 1 builduser builduser 0 Sep 26 14:21 fool
如果我在x86_64
容器中运行,它也可以在NFS上运行:
$ docker run --rm -t -v /home/stephen/some-nfs-mount:/home/edge registry.gear.ge.com/predix_edge/edge-agent-x86_64 "cd tmp && make"
Setting uid/gid to 501 501
ls -l
total 4
-rw-r--r-- 1 builduser builduser 26 Sep 25 17:58 Makefile
-rw-r--r-- 1 builduser builduser 0 Sep 25 17:58 bart
-rw-r--r-- 1 builduser builduser 0 Sep 25 17:58 fool
ls -l foo*
-rw-r--r-- 1 builduser builduser 0 Sep 25 17:58 fool
i386
容器是FROM i386/ubuntu:18.04
,而x86_64
容器是FROM ubuntu:18.04
。
除了“不使用NFS”之外,还有其他方法可以解决此问题吗?
答案 0 :(得分:1)
外壳上的i386图像声音通配符功能已被禁用。
尝试set +o noglob
为您的registry.gear.ge.com/predix_edge/edge-agent-i386
启用它。
一些类似的试验,仅供参考。
# set -o noglob
# ls Doc*
ls: cannot access Doc*: No such file or directory
# set +o noglob
# ls Doc*
Dockerfile