From 63f4e212cb066d6f04fa47e9b557c3ced47ad808 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 31 Aug 2017 19:45:00 +0200 Subject: [PATCH] Install LXC in 01-basic.sh --- 01-basic.sh | 16 ++++++++++++++++ basic/etc/default/lxc-net | 1 + basic/etc/lxc/default.conf | 4 ++++ 3 files changed, 21 insertions(+) create mode 100644 basic/etc/default/lxc-net create mode 100644 basic/etc/lxc/default.conf diff --git a/01-basic.sh b/01-basic.sh index 80fc265..f750caf 100644 --- a/01-basic.sh +++ b/01-basic.sh @@ -24,6 +24,7 @@ cp ${SOURCE_DIR}/basic/root/.ssh/authorized_keys /root/.ssh/authorized_keys # Remove default user deluser --remove-all-files user 2>/dev/null + ##### # System boot ##### @@ -52,6 +53,21 @@ update-initramfs -u update-grub +##### +# LXC +##### + +# Install packages +apt-get --no-install-recommends install lxc debootstrap rsync dnsmasq-base xz-utils + +# Configure LXC +cp ${SOURCE_DIR}/basic/etc/default/lxc-net /etc/default/lxc-net +cp ${SOURCE_DIR}/basic/etc/lxc/default.conf /etc/lxc/default.conf + +# Restart services +systemctl start lxc-net lxc + + ##### # Nginx + uWSGI ##### diff --git a/basic/etc/default/lxc-net b/basic/etc/default/lxc-net new file mode 100644 index 0000000..5d52f62 --- /dev/null +++ b/basic/etc/default/lxc-net @@ -0,0 +1 @@ +USE_LXC_BRIDGE="true" diff --git a/basic/etc/lxc/default.conf b/basic/etc/lxc/default.conf new file mode 100644 index 0000000..661718b --- /dev/null +++ b/basic/etc/lxc/default.conf @@ -0,0 +1,4 @@ +lxc.network.type = veth +lxc.network.link = lxcbr0 +lxc.network.flags = up +lxc.network.hwaddr = 00:16:3e:xx:xx:xx