From bc2c91ae99b4104f49827baeab32a71b5aa21d50 Mon Sep 17 00:00:00 2001 From: Felix Abecassis Date: Tue, 21 Nov 2017 13:49:30 -0800 Subject: [PATCH] lxc-oci: write /etc/hostname Signed-off-by: Felix Abecassis --- templates/lxc-oci.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/lxc-oci.in b/templates/lxc-oci.in index dac3eebec..3a52acd9d 100755 --- a/templates/lxc-oci.in +++ b/templates/lxc-oci.in @@ -204,7 +204,11 @@ LXC_CONF_FILE="${LXC_PATH}/config" echo "lxc.execute.cmd = '${entrypoint}'" >> "${LXC_CONF_FILE}" echo "lxc.mount.auto = proc:mixed sys:mixed cgroup:mixed" >> "${LXC_CONF_FILE}" -echo "lxc.uts.name = ${LXC_NAME}" >> ${LXC_PATH}/config +echo "lxc.uts.name = ${LXC_NAME}" >> "${LXC_CONF_FILE}" +# set the hostname +cat < ${LXC_ROOTFS}/etc/hostname +${LXC_NAME} +EOF if [ -n "$LXC_MAPPED_UID" ] && [ "$LXC_MAPPED_UID" != "-1" ]; then chown $LXC_MAPPED_UID $LXC_PATH/config $LXC_PATH/fstab >/dev/null 2>&1 || true -- 2.47.2