Skip to content

Instantly share code, notes, and snippets.

@mkmkme
Created June 22, 2017 09:18
Show Gist options
  • Save mkmkme/f7e3456e19460175d7fb9ac4f5e180f4 to your computer and use it in GitHub Desktop.
Save mkmkme/f7e3456e19460175d7fb9ac4f5e180f4 to your computer and use it in GitHub Desktop.
Create minimal ubuntu zesty install into /var/lib/machines
#!/bin/sh -efux
die() {
printf "%s\n" "$*"
exit 1
}
[ "$#" -ne 1 ] && die "Usage: $(basename ${0}) PATH"
[ $(id -u) -ne 0 ] && die "must be root"
install_path="$1"
[ -z "${install_path}" ] && die "install path must be not empty"
debootstrap --variant=minbase \
--include=dbus,isc-dhcp-client,iputils-ping,iproute2,python,systemd \
zesty \
"${install_path}" \
http://mirror.yandex.ru/ubuntu
cat <<EOF
APT::Install-Recommends "false";
APT::Install-Suggests "false";
EOF >"${install_path}"/etc/apt/apt.conf.d/99no-install-recommends
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment