aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-05-23 14:34:24 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2017-05-23 14:35:54 +0200
commitce44a928921cd0c87be29f2fc6aa10d200456aab (patch)
tree468ac5437424f78ab554b5729a7abe5eaf775ed3 /main
parentf05576a33b0944b8319b377c414c7c8dc659796a (diff)
downloadaports-ce44a928921cd0c87be29f2fc6aa10d200456aab.tar.bz2
aports-ce44a928921cd0c87be29f2fc6aa10d200456aab.tar.xz
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.
Diffstat (limited to 'main')
-rw-r--r--main/lxc/APKBUILD34
1 files changed, 31 insertions, 3 deletions
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 <<EOF
+ BRIDGE_ADDR="10.0.3.1"
+ BRIDGE_NETMASK="255.255.255.0"
+ BRIDGE_NETWORK="10.0.3.0/24"
+ BRIDGE_DHCP_RANGE="10.0.3.2,10.0.3.254"
+ BRIDGE_DHCP_MAX="253"
+ BRIDGE_MAC="00:16:3e:00:00:00"
+ DNSMASQ_CONFFILE="/etc/lxc/dnsmasq.conf"
+EOF
+ cat ->>"$subpkgdir"/etc/lxc/dnsmasq.conf <<EOF
+ #dhcp-host=somehost,10.0.3.3
+ #dhcp-host=otherhost,10.0.3.4
+EOF
+ cat ->>"$subpkgdir"/etc/conf.d/lxc <<EOF
+ rc_need="lxc-bridge"
+EOF
+
+}
+
+
sha512sums="eb48dc800ce43d2f4d46e0cecc4d0a714b3e22c6a4975776b54d17d1d20d5a1411e6b605215282f1f77286ddf22b61c80b86b83752191fc18023894ef7a1c44d lxc-2.0.7.tar.gz
e2ffcbf55447291a8434a4f37255c3a6a119bc4116c75d205006aa2b070bf6be28535cf6107bead14bbf64bf9fa415346ab544bd1c15e1add7d1c6380e6b2def version.patch
1037e0b773553aa04b619cec7cfc8fa504af830e58c8211eda367da7e36aeb88f45fca1f955a08fc4fa3f9da660017d5fe7145a326a2064cf15e24d1772d9e27 lxc.initd