需要注意 挂载行为会覆盖容器目标目录的原有内容(未验证)。
在容器外部查看:
docker inspect | grep -A n \"Mounts\"
-A n
-A 是 --after-context 的缩写,表示显示匹配行及其后 n 行。
-A
--after-context
\"Mounts\" 是要搜索的关键词(即 Docker 容器挂载信息的 JSON 字段)。
\"Mounts\"
\"Mounts\": [ { \"Type\": \"bind\", \"Source\": \"/home/wjy\",