From 7f03eea41eecadb18d7d5baf5ab2ad8c1a3762f6 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 5 Oct 2013 11:18:56 +0200 Subject: [PATCH] Add lxc-docker.install Adding this install script, which adds a `docker' group, allows users to be added to the `docker' group, which in turn allows them to run the docker client without being root. --- lxc-docker/PKGBUILD | 3 ++- lxc-docker/lxc-docker.install | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 lxc-docker/lxc-docker.install diff --git a/lxc-docker/PKGBUILD b/lxc-docker/PKGBUILD index bcf4d6c..a46992d 100644 --- a/lxc-docker/PKGBUILD +++ b/lxc-docker/PKGBUILD @@ -9,7 +9,7 @@ # Maintainer: frio pkgname=lxc-docker pkgver=0.6.3 -pkgrel=1 +pkgrel=2 pkgdesc="Docker - the Linux container runtime" arch=('x86_64') url="https://github.com/dotcloud/docker" @@ -26,6 +26,7 @@ sha1sums=( 'f6c700a8fe20d1399409046ca74bd52c37678c0c' 'b040b6fa5465a4ded3239c58bdcc0195a0d196f0' ) +install=lxc-docker.install package() { # install systemd service unit diff --git a/lxc-docker/lxc-docker.install b/lxc-docker/lxc-docker.install new file mode 100644 index 0000000..743ab74 --- /dev/null +++ b/lxc-docker/lxc-docker.install @@ -0,0 +1,18 @@ +post_install() +{ + if ! getent group docker >/dev/null; then + groupadd --system docker + fi +} + +post_upgrade() +{ + post_install $1 +} + +post_remove() +{ + if getent group docker >/dev/null; then + groupdel docker + fi +}