From 0b56beea89f9c38eb2f56d08b6ccc299d6cafc17 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Tue, 11 Sep 2018 17:08:09 +0200 Subject: [PATCH] Add auxiliary script for LXC compilation --- build-all.sh | 1 + zz-extra/compile-lxc.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 zz-extra/compile-lxc.sh diff --git a/build-all.sh b/build-all.sh index 5e4666d..788a04b 100755 --- a/build-all.sh +++ b/build-all.sh @@ -9,6 +9,7 @@ alias lxc-build=${SOURCE_DIR}/lxc-build # Build basic Alpine LXC image mkdir -p /var/lib/lxc/shared/alpine wget https://github.com/gliderlabs/docker-alpine/raw/2bfe6510ee31d86cfeb2f37587f4cf866f28ffbc/versions/library-3.8/x86_64/rootfs.tar.xz -O - | tar xJf - -C /var/lib/lxc/shared/alpine +chmod 755 /var/lib/lxc/shared/alpine touch /var/lib/lxc/shared/alpine/etc/resolv.conf lxc-build ${SOURCE_DIR}/basic-runtimes/alpine.lxcfile diff --git a/zz-extra/compile-lxc.sh b/zz-extra/compile-lxc.sh new file mode 100755 index 0000000..5aeb770 --- /dev/null +++ b/zz-extra/compile-lxc.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +apk --no-cache add build-base gzip libcap-dev lvm2 util-linux automake autoconf libtool lua5.3-dev linux-headers bash tar docbook2x libseccomp-dev python3-dev dnsmasq py3-setuptools git xz + +git clone --depth=1 https://github.com/lxc/lxc.git +cd lxc + +./autogen.sh + +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-apparmor \ + --with-distro=alpine \ + --disable-werror + +make -j $(getconf _NPROCESSORS_ONLN) + +mkdir /tmp/lxc +make DESTDIR=/tmp/lxc install + +cd /tmp/lxc +rm -rf usr/include/ +rm -rf usr/lib/liblxc.a +rm -rf usr/lib/liblxc.la +rm -rf usr/lib/pkgconfig/ +rm -rf usr/share/doc/ +rm -rf usr/share/lxc/selinux/ +rm -rf usr/share/lxc/templates/ +rm -rf usr/share/man/ + +find . | xargs -n 1 strip -s + +tar cf - * | xz -9 -c - >../lxc.tar.xz