From ce44a928921cd0c87be29f2fc6aa10d200456aab Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 23 May 2017 14:34:24 +0200 Subject: main/lxc: add lxc-bridge subpackage add a subpackage with a default lxcbr0 bridge interface with dnsmasq This makes it very convenient to set up a private network for lxc containers with a config that works out of the box. --- main/lxc/APKBUILD | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'main') diff --git a/main/lxc/APKBUILD b/main/lxc/APKBUILD index 130fd0cddc..381d4c832c 100644 --- a/main/lxc/APKBUILD +++ b/main/lxc/APKBUILD @@ -5,7 +5,7 @@ pkgname=lxc pkgver=2.0.7 _pkgver=${pkgver/_rc/.rc} -pkgrel=2 +pkgrel=3 pkgdesc="Userspace interface for the Linux kernel containment features" url="https://linuxcontainers.org/lxc/" arch="all" @@ -13,11 +13,11 @@ license="GPL" depends="gzip" depends_dev="libcap-dev" makedepends="$depends_dev lvm2 util-linux automake autoconf libtool lua5.2-dev - linux-headers bash tar docbook2x libseccomp-dev python3-dev" + linux-headers bash tar docbook2x libseccomp-dev python3-dev dnsmasq" options="suid" subpackages="$pkgname-dev $pkgname-doc $pkgname-lvm::noarch lua5.2-lxc:_lua52 $pkgname-download:_download:noarch $pkgname-templates::noarch $pkgname-libs - py3-$pkgname:_py3" + py3-$pkgname:_py3 $pkgname-bridge" source="https://github.com/lxc/lxc/archive/lxc-$_pkgver.tar.gz version.patch lxc.initd @@ -119,6 +119,34 @@ dev() { mv "$subpkgdir"/usr/bin/lxc-config "$pkgdir"/usr/bin/ } +bridge() { + depends="dnsmasq" + pkgdesc="Bridge interface for LXC with dhcp" + mkdir -p "$subpkgdir"/etc/conf.d \ + "$subpkgdir"/etc/init.d \ + "$subpkgdir"/etc/lxc + + ln -s dnsmasq "$subpkgdir"/etc/init.d/dnsmasq.lxcbr0 + cat ->>"$subpkgdir"/etc/conf.d/dnsmasq.lxcbr0 <>"$subpkgdir"/etc/lxc/dnsmasq.conf <>"$subpkgdir"/etc/conf.d/lxc <