summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docker/.footprint13
-rw-r--r--docker/.md5sum3
-rw-r--r--docker/.nostrip1
-rw-r--r--docker/Pkgfile42
-rw-r--r--docker/README81
-rw-r--r--docker/docker.conf5
-rwxr-xr-xdocker/docker.rc34
-rwxr-xr-xdocker/post-install4
-rwxr-xr-xdocker/test_kernel_config.sh55
9 files changed, 238 insertions, 0 deletions
diff --git a/docker/.footprint b/docker/.footprint
new file mode 100644
index 000000000..c4e6f1d6e
--- /dev/null
+++ b/docker/.footprint
@@ -0,0 +1,13 @@
+drwxr-xr-x root/root etc/
+-rw-r--r-- root/root etc/docker.conf
+drwxr-xr-x root/root etc/rc.d/
+-rwxr-xr-x root/root etc/rc.d/docker
+drwxr-xr-x root/root etc/udev/
+drwxr-xr-x root/root etc/udev/rules.d/
+-rw-r--r-- root/root etc/udev/rules.d/80-docker.rules
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwxr-xr-x root/root usr/bin/docker
+drwxr-xr-x root/root usr/lib/
+drwxr-xr-x root/root usr/lib/docker/
+-rwxr-xr-x root/root usr/lib/docker/dockerinit
diff --git a/docker/.md5sum b/docker/.md5sum
new file mode 100644
index 000000000..866390ffc
--- /dev/null
+++ b/docker/.md5sum
@@ -0,0 +1,3 @@
+966e1916d611427c44686ad09145996f docker.conf
+dcaae2f852c97ba73436c77cda3eb4e3 docker.rc
+737aec190c2ad81b00192f858f9ed31b v0.8.0.tar.gz
diff --git a/docker/.nostrip b/docker/.nostrip
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/docker/.nostrip
@@ -0,0 +1 @@
+.*
diff --git a/docker/Pkgfile b/docker/Pkgfile
new file mode 100644
index 000000000..a8150b701
--- /dev/null
+++ b/docker/Pkgfile
@@ -0,0 +1,42 @@
+# Description: Pack, ship and run any application as a lightweight container
+# URL: http://www.docker.io/
+# Maintainer: James Mills, prologic at shortcircuit dot net dot au
+# Packager: Sébastien "Seblu" Luttringer
+#
+# Depends on: go bridge-utils lxc sqlite3
+
+name=docker
+version=0.8.0
+revision=cc3a8c8d8e
+release=2
+source=(
+ https://github.com/dotcloud/$name/archive/v$version.tar.gz
+ $name.rc
+ $name.conf
+)
+
+_magic=src/github.com/dotcloud
+
+PKGMK_NO_STRIP="yes"
+
+build() {
+ # symlink vendor packages
+ mkdir -p "$SRC/$_magic"
+ ln -sfn "../../../$name-$version" "$_magic/docker"
+
+ cd $name-$version
+
+ # Build
+ export GOPATH="$SRC:$SRC/$_magic/docker/vendor"
+ export DOCKER_GITCOMMIT=$revision
+ ./hack/make.sh dynbinary
+
+ # Package
+ install -Dm755 "bundles/$version/dynbinary/docker-$version" "$PKG/usr/bin/docker"
+ install -Dm755 "bundles/$version/dynbinary/dockerinit-$version" "$PKG/usr/lib/docker/dockerinit"
+ install -Dm644 "contrib/udev/80-docker.rules" "$PKG/etc/udev/rules.d/80-docker.rules"
+ install -D -m 755 $SRC/$name.rc $PKG/etc/rc.d/$name
+ install -D -m 644 $SRC/$name.conf $PKG/etc/$name.conf
+
+ chown -R root:root $PKG
+}
diff --git a/docker/README b/docker/README
new file mode 100644
index 000000000..5f524a48f
--- /dev/null
+++ b/docker/README
@@ -0,0 +1,81 @@
+Kernel Requirements
+===================
+
+
+If you want to have a full working CRUX+Docker system you will need to rebuild your kernel with the following options enabled:
+
+Networking:
+
+- CONFIG_BRIDGE
+- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE
+- CONFIG_NF_NAT
+- CONFIG_NF_NAT_IPV4
+- CONFIG_NF_NAT_NEEDED
+
+LVM:
+
+- CONFIG_BLK_DEV_DM
+- CONFIG_DM_THIN_PROVISIONING
+- CONFIG_EXT4_FS
+
+Namespaces:
+- CONFIG_NAMESPACES
+- CONFIG_UTS_NS
+- CONFIG_IPC_NS
+- CONFIG_UID_NS
+- CONFIG_PID_NS
+- CONFIG_NET_NS
+
+Cgroups:
+
+- CONFIG_CGROUPS
+
+Cgroups Controllers (*optional but highly recommended*):
+
+- CONFIG_CGROUP_CPUACCT
+- CONFIG_BLK_CGROUP
+- CONFIG_MEMCG
+- CONFIG_MEMCG_SWAP
+
+You may check your kernel configuration by running the provided ``test_kernel_config.sh`` script against your kernel configuration:
+
+::
+
+ ./test_kernel_config.sh /usr/src/linux/.config
+
+
+Other Requirements
+==================
+
+
+You **must** have the following ``cgroup`` mount point mounted:
+
+::
+
+ none /cgroup cgroup defaults 0 0
+
+
+Storage Backends
+================
+
+Docker comes with three main Storage Backends:
+
+- AUFS (*requires AUFS kernel/patches*)
+- devmapper
+- btrfs
+
+It is recommended you use the devmapper or btrfs backend (Default: devmapper).
+
+To use the ``btrfs`` backend edit ``/etc/docker.conf`` and modify the ``DOCKER_OPTS`` with:
+
+::
+
+ DOCKER_OPTS="-s btrfs"
+
+
+Docker Client
+=============
+
+The provided Docker rc script changes the group ownership of the ``/var/run/socker.sock`` UNIX Socket to ``docker``.
+
+Add yourself to this group if you wish to access the Docker daemon on localhost via UNIX Socker.
diff --git a/docker/docker.conf b/docker/docker.conf
new file mode 100644
index 000000000..0b2644b95
--- /dev/null
+++ b/docker/docker.conf
@@ -0,0 +1,5 @@
+# Docker Daemon Configuration
+
+DOCKER_OPTS="-d -p /var/run/docker.pid -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock"
+
+# vim: syntax=sh
diff --git a/docker/docker.rc b/docker/docker.rc
new file mode 100755
index 000000000..4298b6bf3
--- /dev/null
+++ b/docker/docker.rc
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# /etc/rc.d/docker: start/stop docker daemon
+#
+
+source /etc/docker.conf
+
+case $1 in
+start)
+ nohup /usr/bin/docker $DOCKER_OPTS &> /var/log/docker.log &
+ touch /var/run/docker.sock
+ chgrp docker /var/run/docker.sock
+ ;;
+stop)
+ if [ -f /var/run/docker.pid ]; then
+ kill $(< /var/run/docker.pid)
+ rm -f /var/run/docker.pid
+ rm -f /var/run/docker.sock
+ else
+ killall -q /usr/bin/docker
+ rm -f /var/run/docker.sock
+ fi
+ ;;
+restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+*)
+ echo "usage: $0 [start|stop|restart]"
+ ;;
+esac
+
+# End of file
diff --git a/docker/post-install b/docker/post-install
new file mode 100755
index 000000000..a75854dbf
--- /dev/null
+++ b/docker/post-install
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+# create docker group
+getent group docker > /dev/null || groupadd -g 142 docker
diff --git a/docker/test_kernel_config.sh b/docker/test_kernel_config.sh
new file mode 100755
index 000000000..713df59ac
--- /dev/null
+++ b/docker/test_kernel_config.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+# Script to check Kernel Config
+# Options taken from: http://docs.docker.io/en/latest/installation/kernel/
+#
+# USAGE: ./testconfig.sh [ /path/to/kernel/config ]
+
+if [[ $# -lt 1 ]]; then
+ if [[ -e /proc/config.gz ]]; then
+ CONFIG=$(mktemp)
+ zcat /proc/config.gz > $CONFIG
+ else
+ echo "Usage: $self [ /path/to/kernel/config ]"
+ exit 1
+ fi
+else
+ CONFIG=${1}
+fi
+
+echo "Checking Networking:"
+egrep "CONFIG_BRIDGE=.$" $CONFIG
+egrep "CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=.$" $CONFIG
+egrep "CONFIG_NF_NAT=.$" $CONFIG
+egrep "CONFIG_NF_NAT_IPV4=.$" $CONFIG
+egrep "CONFIG_NF_NAT_NEEDED=.$" $CONFIG
+echo
+
+echo "Checking LVM:"
+egrep CONFIG_BLK_DEV_DM $CONFIG
+egrep CONFIG_DM_THIN_PROVISIONING $CONFIG
+egrep CONFIG_EXT4_FS $CONFIG
+echo
+
+echo "Checking Namespaces:"
+egrep CONFIG_NAMESPACES $CONFIG
+egrep CONFIG_UTS_NS $CONFIG
+egrep CONFIG_IPC_NS $CONFIG
+egrep CONFIG_UID_NS $CONFIG
+egrep CONFIG_PID_NS $CONFIG
+egrep CONFIG_NET_NS $CONFIG
+echo
+
+echo "Checking Cgroups:"
+egrep CONFIG_CGROUPS $CONFIG
+echo
+
+echo "Checkin gCgroup controllers (optional but highly recommended):"
+egrep CONFIG_CGROUP_CPUACCT $CONFIG
+egrep CONFIG_BLK_CGROUP $CONFIG
+egrep CONFIG_MEMCG $CONFIG
+egrep CONFIG_MEMCG_SWAP $CONFIG
+echo
+
+echo "Running lxc-checkconfig:"
+CONFIG=$CONFIG /usr/bin/lxc-checkconfig

Generated by cgit