[root@localhost ~]# docker run -d -p 5000:5000 -v /zzyyuse/myregistry/:/tmp/registry --privileged=true registry
[root@localhost /]# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var zzyyuse
[root@localhost zzyyuse]# ls
myregistry
[root@localhost zzyyuse]# cd myregistry/
[root@localhost myregistry]# ll
总用量 0
[root@localhost myregistry]# docker run -it --privileged=true -v /myhost/test:/myclient/test --name=u1 ubuntu
root@b21ce3d73a58:/# ls
bin boot dev etc home lib lib32 lib64 libx32 media mnt myclient opt proc root run sbin srv sys tmp usr var
root@b21ce3d73a58:/# cd myclient/
root@b21ce3d73a58:/myclient# ls
test
root@b21ce3d73a58:/myclient# cd test/
root@b21ce3d73a58:/myclient/test# ls
root@b21ce3d73a58:/myclient/test#
[root@localhost /]# ls
bin boot dev etc home lib lib64 media mnt myhost opt proc root run sbin srv sys tmp usr var zzyyuse
[root@localhost /]# cd myhost/
[root@localhost /]# cd myhost/
[root@localhost myhost]# ls
test
[root@localhost myhost]# cd test/
[root@localhost test]# ls
root@b21ce3d73a58:/myclient/test# touch client.txt
root@b21ce3d73a58:/myclient/test# ls
client.txt
[root@localhost test]# ls
client.txt
[root@localhost test]# docker inspect u1
"Mounts": [
{
"Type": "bind",
"Source": "/myhost/test",
"Destination": "/myclient/test",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],