怎么查看映射docker容器的路径
使用下面命令即可。container_name 是容器的名字,也可以写容器的ID。
$ docker inspect container_name | grep Mounts -A 20
输出示例:
"Mounts": [ { "Type": "bind", "Source": "/usr/bin/docker", "Destination": "/usr/bin/docker", "Mode": "", "RW": true, "Propagation": "rprivate" }, { "Type": "bind", "Source": "/usr/lib64/libltdl.so.7", "Destination": "/usr/lib/x86_64-linux-gnu/libltdl.so.7", "Mode": "", "RW": true, "Propagation": "rprivate" }, { "Type": "bind", "Source": "/var/jenkins_home", "Destination": "/var/jenkins_home",
注:获取容器ID可使用docker ps -a命令
输出示例:
CONTAINER ID IMAGE COMMAND ... PORTS NAMES 09b93464c2f7 nginx:latest "nginx -g 'daemon off" ... 80/tcp, 443/tcp myrunoob 96f7f14e99ab mysql:5.6 "docker-entrypoint.sh" ... 0.0.0.0:3306->3306/tcp mymysql
更多相关教程,请关注PHP中文网docker教程栏目。
以上是怎么查看映射docker容器的路径的详细内容。更多信息请关注PHP中文网其他相关文章!