docker 容器启动后,还能通过命令行挂接存储卷么

2022-08-06 教育 300阅读
docker 容器启动后,再通过命令行很难挂载一个存储卷。因为mnt在容器运行过程中要在自己的工作空间执行。
通过以下步骤可以挂载:
(1)use nsenter to mount the whole filesystem containing this volume on a temporary mountpoint;
(2)create a bind mount from the specific directory that we want to use as the volume, to the right location of this volume;
(3)umount the temporary mountpoint.
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com