如何从lxc挂载文件夹 [英] how to mount a folder from lxc
问题描述
我有lxc,它有一个正在运行的应用程序. 要在自己的计算机(Ubuntu 13.10)上编辑此应用程序的代码,我想挂载目录lxc.该怎么办?
I have the lxc, it has a running application. To edit the code of this application on own computer(Ubuntu 13.10), I want to mount a directory lxc. How can this be done?
例如
/var/lib/lxc/ubuntu_12_04/rootfs/home/
/var/lib/lxc/ubuntu_12_04/rootfs/home/
安装在/mnt/lxc中
mounted in /mnt/lxc
推荐答案
如果您希望在每次启动lxc时自动在lxc中安装目录,则可以使用/var/lib/lxc/ubuntu_12_04/config
文件中的lxc.mount.entry
目录.带有类似的东西:
If you want to mount automatically a directory inside the lxc each time you start the lxc you can use the lxc.mount.entry
directory inside /var/lib/lxc/ubuntu_12_04/config
file. With Something like:
lxc.mount.entry = /mnt/lxc home/ none bind 0 0
这会将/mnt/lxc
安装在home/
目录下的lxc根文件系统(也称为rootfs)内.
This will mount /mnt/lxc
inside the lxc root filesystem aka rootfs at home/
directory.
这篇关于如何从lxc挂载文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!