Added docker (NEW): Pack, ship and run any application as a lightweight container
--HG-- extra : rebase_source : cc858dc476da842977d165be0c5dae78817f7738
This commit is contained in:
parent
b1acddc02f
commit
ffb8c97c11
13
docker/.footprint
Normal file
13
docker/.footprint
Normal file
@ -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
|
3
docker/.md5sum
Normal file
3
docker/.md5sum
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
966e1916d611427c44686ad09145996f docker.conf
|
||||||
|
dcaae2f852c97ba73436c77cda3eb4e3 docker.rc
|
||||||
|
737aec190c2ad81b00192f858f9ed31b v0.8.0.tar.gz
|
1
docker/.nostrip
Normal file
1
docker/.nostrip
Normal file
@ -0,0 +1 @@
|
|||||||
|
.*
|
42
docker/Pkgfile
Normal file
42
docker/Pkgfile
Normal file
@ -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
|
||||||
|
}
|
81
docker/README
Normal file
81
docker/README
Normal file
@ -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.
|
5
docker/docker.conf
Normal file
5
docker/docker.conf
Normal file
@ -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
|
34
docker/docker.rc
Executable file
34
docker/docker.rc
Executable file
@ -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
|
4
docker/post-install
Executable file
4
docker/post-install
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# create docker group
|
||||||
|
getent group docker > /dev/null || groupadd -g 142 docker
|
55
docker/test_kernel_config.sh
Executable file
55
docker/test_kernel_config.sh
Executable file
@ -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
|
Loading…
x
Reference in New Issue
Block a user