Skip to content

Commit

Permalink
lxc-oci: write /etc/hostname
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
  • Loading branch information
flx42 committed Nov 22, 2017
1 parent 51c8057 commit bc2c91a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion templates/lxc-oci.in
Expand Up @@ -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 <<EOF > ${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
Expand Down

0 comments on commit bc2c91a

Please sign in to comment.