Skip to content

Commit

Permalink
fix: properly populate /etc/hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
ymauray committed Nov 25, 2022
1 parent 689b6b4 commit d045ea9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion machinespawn
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ function container_bootstrap() {

# Make sure the container has a machine-id
systemd-machine-id-setup --root "${R}" --print
echo "127.0.0.1 localhost ${NAME}" > "${R}/etc/hosts"

# Set locale to C.UTF-8 by default.
# https://git.launchpad.net/livecd-rootfs/tree/live-build/auto/build#n159
Expand All @@ -139,6 +138,10 @@ deb http://${ARCHIVE} ${DISTRO_RELEASE}-security ${COMPONENTS//,/ }" > "${R}/etc
echo "WARNING! ${R} already exists!"
fi
machinectl import-fs "${R}" "${NAME}"

# Make sure /etc/hosts is set for the imported machine
R="${MACHINE_DIR}/${NAME}"
echo "127.0.0.1 localhost ${NAME}" > "${R}/etc/hosts"
}

function container_pull_tar() {
Expand Down

0 comments on commit d045ea9

Please sign in to comment.