MacOS下/var/lib/docker 的存放位置

2019-03-23  本文已影响0人  寻找傅里叶

Docker版本:18.09.2, build 6247962
OS版本:MacOS Mojave 10.14.3

学习docker的挂载时,想看一下挂载的是本机的哪个地址:

docker run -d --name test-nginx -v /usr/share/nginx/html nginx
docker inspect test-nginx

查询到:

...
        "Mounts": [
            {
                "Type": "volume",
                "Name": "83af3ea2681490a5804183e427da3aa50241e31d1a39145b082b5aeca945a6f7",
                "Source": "/var/lib/docker/volumes/83af3ea2681490a5804183e427da3aa50241e31d1a39145b082b5aeca945a6f7/_data",
                "Destination": "/usr/share/nginx/html",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ],
...

然而Source这个地址在本机中并不存在,在更新后的docker中应当使用:

screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty

进去之后默认是空白页面,需要按下Enter

linuxkit-025000000001:/# pwd
/
linuxkit-025000000001:/# ls
EFI         dev         lib         proc        sendtohost  usr
bin         etc         media       root        srv         var
boot        home        mnt         run         sys
containers  init        opt         sbin        tmp
linuxkit-025000000001:/# ls /var/lib/docker/volumes/83af3ea2681490a5804183e427da
3aa50241e31d1a39145b082b5aeca945a6f7/_data
50x.html    index.html
linuxkit-025000000001:/#
上一篇下一篇

猜你喜欢

热点阅读