lxc-oci: import common.conf and userns.conf

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
This commit is contained in:
Felix Abecassis 2017-11-21 13:49:40 -08:00
parent 996202e74a
commit d7c685c6be

View File

@ -34,6 +34,8 @@ for bin in skopeo umoci jq; do
fi
done
LXC_TEMPLATE_CONFIG="@LXCTEMPLATECONFIG@"
# Some useful functions
cleanup() {
if [ -d "$DOWNLOAD_TEMP" ]; then
@ -233,6 +235,14 @@ while read -r line; do
echo "lxc.environment = ${line}" >> "${LXC_CONF_FILE}"
done <<< "${environment}"
if [ -e "${LXC_TEMPLATE_CONFIG}/common.conf" ]; then
echo "lxc.include = ${LXC_TEMPLATE_CONFIG}/common.conf" >> "${LXC_CONF_FILE}"
fi
if [ -n "$LXC_MAPPED_UID" ] && [ "$LXC_MAPPED_UID" != "-1" ] && [ -e "${LXC_TEMPLATE_CONFIG}/userns.conf" ]; then
echo "lxc.include = ${LXC_TEMPLATE_CONFIG}/userns.conf" >> "${LXC_CONF_FILE}"
fi
echo "lxc.uts.name = ${LXC_NAME}" >> "${LXC_CONF_FILE}"
# set the hostname
cat <<EOF > ${LXC_ROOTFS}/etc/hostname