環(huán)境
- MAC Big Sur 11.01
- Docker Desktop for Mac 20.10.8
問題所在
使用docker數(shù)據(jù)卷技術(shù)時(shí)因块,找不到系統(tǒng)默認(rèn)路徑/var/lib/docker/曲初,網(wǎng)上所以方法不適用管毙,通過
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
并不能達(dá)到目的铃将,因?yàn)楸緳C(jī)根本沒用tty這個(gè)文件J车辍v荨!?勰摇!
解決方法
使用鏡像justincormack/nsenter1
進(jìn)入VM就可以訪問/var/lib/docker 了
具體操作
# 拉取鏡像并運(yùn)行進(jìn)入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
問題解決G中!吓蘑!