顯示具有 File system 標籤的文章。 顯示所有文章
顯示具有 File system 標籤的文章。 顯示所有文章

2017年12月6日 星期三

Mount Physical Host file system to Container


Physical host file system and source build

1. Ensure Container is shutdown

2. Edit config file
$ sudo vi /var/lib/lxc/myHDP2/config
:::
# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf

# Container specific configuration
lxc.rootfs = /var/lib/lxc/myHDP2/rootfs
lxc.rootfs.backend = dir
lxc.mount = /var/lib/lxc/myHDP2/fstab (Added it)
lxc.utsname = myHDP2
lxc.arch = amd64
:::

3. Edit fstab file
$ sudo cat /var/lib/lxc/myHDP2/fstab
/opt /var/lib/lxc/myHDP2/rootfs/opt none bind 0 0

4. Container power on
5. Check file system


Refer: Ubuntu 和 LXC Container 互相存取檔案
Read more: http://www.arthurtoday.com/2015/03/ubuntu-exchanges-data-with-containers.html#ixzz50XjXu0wFhttp://www.arthurtoday.com/2015/03/ubuntu-exchanges-data-with-containers.html

Docker Command

#1 pull images $docker pull chusiang/takaojs1607 #2 list images $docker images #3.1 run docker $docker run -it ### bash #3.2 run do...