Docker如何查看容器映射路径
作者:风中~少年
这篇文章主要介绍了Docker如何查看容器映射路径问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教
docker查看容器映射路径
使用以下命令:
container_name 是容器的名字,也可以写容器的ID。
$ docker inspect container_name | grep Mounts -A 20
查询结果:
[root@localhost /]# docker inspect d2a6a115a42b | grep Mounts -A 20 "Mounts": [ { "Type": "bind", "Source": "/work/mysql/conf", "Destination": "/etc/mysql/conf.d", "Mode": "", "RW": true, "Propagation": "rprivate" }, { "Type": "bind", "Source": "/work/mysql/logs", "Destination": "/logs", "Mode": "", "RW": true, "Propagation": "rprivate" }, { "Type": "bind", "Source": "/work/mysql/data", "Destination": "/var/lib/mysql",
docker路径映射
docker run -it --name test02 -v /c/Users/gaoxuanyu/Downloads:/home/ foundrybr:v3.0 /bin/bash
在windows环境下使用docker,windows下载了Linux安装包,使用docker路径映射可以直接在docker容器中直接安装已下载的安装包
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。