docker:如何查看容器的挂载目录

该博客展示了如何通过`docker inspect`命令查看Docker容器的挂载信息,包括`container_name`和`container_id`。内容显示了多个`bind`类型的挂载,将宿主机的特定目录挂载到容器内部,例如`/usr/bin/docker`、`/usr/lib64/libltdl.so.7`和`/var/jenkins_home`。
摘要由CSDN通过智能技术生成
docker inspect container_name | grep Mounts -A 20
docker inspect container_id | grep Mounts -A 20
[root@localhost lib64]# docker ps
CONTAINER ID IMAGE           COMMAND               CREATED     STATUS     PORTS                                            NAMES
9cb8be23988c jenkins_yto:v1 "/sbin/tini -- /usr/…" 8 weeks ago Up 2 hours 0.0.0.0:50000->50000/tcp, 0.0.0.0:8081->8080/tcp jenkins_docker


[root@localhost lib64]# docker inspect jenkins_docker | 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",
[root@localhost lib64]# docker inspect 9cb8 | 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",
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值