解决mac找不到 /var/lib/docker的问题

环境

  • MAC Big Sur 11.01
  • Docker Desktop for Mac 20.10.8

问题所在

使用docker数据卷技术时,找不到系统默认路径/var/lib/docker/,网上所以方法不适用,通过

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

并不能达到目的,因为本机根本没用tty这个文件!!!!!

解决方法

使用镜像justincormack/nsenter1进入VM就可以访问/var/lib/docker 了

具体操作

# 拉取镜像并运行进入VM,然后就可以找到/var/lib/docker
docker run -it --rm --privileged --pid=host justincormack/nsenter1
/ # hostname
docker-desktop
/ # uname -a
Linux docker-desktop 5.10.47-linuxkit #1 SMP Sat Jul 3 21:51:47 UTC 2021 x86_64 Linux
/ # cd /var/lib/docker/containers/
/var/lib/docker/containers # ls

469a5c56d4dcfa1f10228e4a10da5fdef2576d046bf83b99066ded54aeb93f90
a2158f98ccbfe057f8bf4d9c0f3a34b8408ed1bdb22ae72ea90cb781df6af166
b0bca090076ae5e683469b95ef7279b43ae941fb7ad7732ce233057a175225d8
d211d5e9bd3e094b37699e9163825c8941e6eff03c036fd3ffc774364db99493
d4df5c6e11115695fbc4d61cd018ab8a59006a6b9373ba837bf7003df8fd14bb

/var/lib/docker/containers # ls ../volumes/

0bc95ec18e21b6fe455581b48fc8784159e5b3de52037ae0b01dc30a978b3ed7
45f7d5b3f9a819b8035b088d4bfea306f1a54c3c5257cdc0f733d24691be8dcd
54c34557ba83af6f142a0916c7eddc36acdb1652eb9b5123ff5c40f6e1e7e4e8
79d875e4bb162d15417d9a1768b0042c2d08203450dcb904e69f01816927a07a
b2d98f27082a7864f83aaf667858f3fad39a02819cd4e00e61279a7d30589159
backingFsBlockDev
c4a9d80b6636e6dede8c637210dad9abf1b476a63f38848c767802de735a51dc
db8dcda5d651ec433d83cfeee5dd6d4be198a13d9fe5c103410060addab014ac
metadata.db
nginxconfig

问题解决!!!

你可能感兴趣的:(解决mac找不到 /var/lib/docker的问题)