Docker容器修改挂载目录

一.关闭docke服务

systemctl stop docker

二.修改容器对应的配置

  • docker容器地址:/var/lib/docker/containers/{容器Id}
  • vim  /var/lib/docker/containers/34907801cd14d61/config.v2.json        #配置文件在/config.v2.json中,修改以下节点
 "MountPoints":{
    "/usr/bin/docker":{
            "Source":"/usr/bin/docker",
            "Destination":"/usr/bin/docker",
            "RW":true,
            "Name":"",
            "Driver":"",
            "Type":"bind",
            "Propagation":"rprivate",
            "Spec":{
                "Type":"bind",
                "Source":"/usr/bin/docker",
                "Target":"/usr/bin/docker"
            },
            "SkipMountpointCreation":false
        }
    }

三.重启docker服务即可

systemctl start docker

 

posted @ 2021-10-20 18:49  hello-*-world  阅读(1488)  评论(0编辑  收藏  举报