Skip to content

Commit

Permalink
lxc-oci: read configuration from oci.common.conf if available
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
  • Loading branch information
3XX0 committed Dec 19, 2017
1 parent bbb8e19 commit 1689c7c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/templates/Makefile.am
Expand Up @@ -21,6 +21,7 @@ templatesconfig_DATA = \
gentoo.moresecure.conf \
gentoo.userns.conf \
nesting.conf \
oci.common.conf \
opensuse.common.conf \
opensuse.userns.conf \
oracle.common.conf \
Expand Down
3 changes: 3 additions & 0 deletions config/templates/oci.common.conf.in
@@ -0,0 +1,3 @@
# Uncomment the following if you want to use DHCP for OCI containers
#lxc.hook.start-host = @LXCHOOKDIR@/dhclient
#lxc.hook.stop = @LXCHOOKDIR@/dhclient
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -737,6 +737,7 @@ AC_CONFIG_FILES([
config/templates/gentoo.moresecure.conf
config/templates/gentoo.userns.conf
config/templates/nesting.conf
config/templates/oci.common.conf
config/templates/opensuse.common.conf
config/templates/opensuse.userns.conf
config/templates/oracle.common.conf
Expand Down
4 changes: 4 additions & 0 deletions templates/lxc-oci.in
Expand Up @@ -313,6 +313,10 @@ if [ -n "$LXC_MAPPED_UID" ] && [ "$LXC_MAPPED_UID" != "-1" ] && [ -e "${LXC_TEMP
echo "lxc.include = ${LXC_TEMPLATE_CONFIG}/userns.conf" >> "${LXC_CONF_FILE}"
fi

if [ -e "${LXC_TEMPLATE_CONFIG}/oci.common.conf" ]; then
echo "lxc.include = ${LXC_TEMPLATE_CONFIG}/oci.common.conf" >> "${LXC_CONF_FILE}"
fi

echo "lxc.uts.name = ${LXC_NAME}" >> "${LXC_CONF_FILE}"
# set the hostname
cat <<EOF > ${LXC_ROOTFS}/etc/hostname
Expand Down

0 comments on commit 1689c7c

Please sign in to comment.