我在LXC中使用嵌套lxc-容器-默认嵌套配置文件,如下所示。
profile lxc-container-default-with-nesting flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/lxc/container-base>
#include <abstractions/lxc/start-container>
# Uncomment the line below if you are not using cgmanager
# mount fstype=cgroup -> /sys/fs/cgroup/**,
deny /dev/.lxc/proc/** rw,
deny /dev/.lxc/sys/** rw,
mount fstype=proc -> /var/cache/lxc/**,
mount fstype=sysfs -> /var/cache/lxc/**,
mount options=(rw,bind),
}下面我有两个问题要问。
mount fstype=proc -> /var/cache/lxc/**,发布于 2016-11-05 22:55:28
嵌套容器配置
该配置文件允许您在另一个容器中创建嵌套 LXC容器。默认情况下,这是禁用的,因为它绕过了一些默认的cgroup限制(这里有更多的信息)。
通常,它更改设备规则以允许lxc重新装入容器内的某些系统资源(有某些限制)。
lxc.container.conf
如果您查看man lxc.container.conf,本节解释可以编辑如何安装proc的设置。我认为默认使用proc:mixed (但我还没有确认这一点)!
lxc.mount.auto
specify which standard kernel file systems should be
automatically mounted. This may dramatically simplify
the configuration. The file systems are:
· proc:mixed (or proc):
mount /proc as read-write, but
remount /proc/sys and
/proc/sysrq-trigger read-only
for security / container isolation purposes.
· proc:rw: mount
/proc as read-write非特权LXC
顺便说一句,如果您没有使用非特权LXC,您应该使用。,认真的。它增加了一个额外的保护层,以限制容器中的root用户所能做的事情(它实际上将其映射到容器之外的非根用户)。这为/proc提供了额外的保护层,以防某些东西被显式规则忽略。
至于它为什么使用/var/cache/lxc,我不知道。一种猜测是,它与cgmanager没有冲突。如果您对推理感兴趣,查看源可能是一个很好的起点。
https://stackoverflow.com/questions/35375525
复制相似问题