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.