怎麼查看映射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中文網其他相關文章!