diff --git a/docker-bin/.md5sum b/docker-bin/.md5sum index 02fab1a6f..c4c7cff78 100644 --- a/docker-bin/.md5sum +++ b/docker-bin/.md5sum @@ -1,3 +1,3 @@ -8f14871d374d0cb991d47ce1ee665b39 docker-0.8.1 +f03ddc7a733a6653979a8395d5bc839a docker-0.9.0 966e1916d611427c44686ad09145996f docker.conf -3af74d547ad9de52745eb29003b540e3 docker.rc +eb65657b29dede7737d13c3c34b8f08d docker.rc diff --git a/docker-bin/Pkgfile b/docker-bin/Pkgfile index e757c1684..f16145146 100644 --- a/docker-bin/Pkgfile +++ b/docker-bin/Pkgfile @@ -1,13 +1,12 @@ # 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: bridge-utils lxc sqlite3 +# Depends on: bridge-utils sqlite3 name=docker-bin -version=0.8.1 -release=2 +version=0.9.0 +release=1 source=( https://get.docker.io/builds/Linux/x86_64/docker-$version docker.rc diff --git a/docker-bin/README b/docker-bin/README index 5f524a48f..d11694b11 100644 --- a/docker-bin/README +++ b/docker-bin/README @@ -1,59 +1,26 @@ Kernel Requirements =================== +If you want to have a full working CRUX+Docker system you will need to rebuild your kernel various networking, cgroups and optional lvm options -If you want to have a full working CRUX+Docker system you will need to rebuild your kernel with the following options enabled: +Please review the provided ``test_kernel_config.sh`` shell script carefully and use this to test your kernel configuration. This README does not document +what these specific options are to vaoid duplication. They are listed instead in ``test_kernel_config.sh``. -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: +You may check your kernel configuration by running: :: ./test_kernel_config.sh /usr/src/linux/.config -Other Requirements -================== +Execution Engines +================= +As of Docker 0.9+ execution engines are pluggable and as such Docker no longer depends on lxc. +The new default execution driver is now an internal ``libcontainer`` driver that replaces the need for lxc. -You **must** have the following ``cgroup`` mount point mounted: +Please see the `Docker Documentation `_ if you want to use a different execution engine other then the default. -:: - - none /cgroup cgroup defaults 0 0 - Storage Backends ================ @@ -76,6 +43,4 @@ To use the ``btrfs`` backend edit ``/etc/docker.conf`` and modify the ``DOCKER_O 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. +Add yourself to the ``docker`` group if you wish to access the Docker daemon on localhost via UNIX Socker. diff --git a/docker-bin/docker.rc b/docker-bin/docker.rc index bfd10b774..2b30603ed 100755 --- a/docker-bin/docker.rc +++ b/docker-bin/docker.rc @@ -7,10 +7,24 @@ 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 - chmod 660 /var/run/docker.sock + # Ensure ownership and permissiong of log file. + touch /var/log/docker.log + chgrp docker /var/log/docker.log + chown 640 /var/log/docker.log + + # Ensure cgroups is properly mounted. (Taken from: https://github.com/dotcloud/docker/blob/v0.9.0/contrib/init/sysvinit-debian/docker#L57-L66) + if ! grep -q cgroup /proc/mounts; then + # rough approximation of cgroupfs-mount + mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup + for sys in $(cut -d' ' -f1 /proc/cgroups); do + mkdir -p /sys/fs/cgroup/$sys + if ! mount -n -t cgroup -o $sys cgroup /sys/fs/cgroup/$sys 2>/dev/null; then + rmdir /sys/fs/cgroup/$sys 2>/dev/null || true + fi + done + fi + + nohup /usr/bin/docker $DOCKER_OPTS > /var/log/docker.log 2>&1 & ;; stop) if [ -f /var/run/docker.pid ]; then diff --git a/docker/.md5sum b/docker/.md5sum index 5070e45e4..99af0a936 100644 --- a/docker/.md5sum +++ b/docker/.md5sum @@ -1,3 +1,3 @@ 966e1916d611427c44686ad09145996f docker.conf -3af74d547ad9de52745eb29003b540e3 docker.rc -3e74f5af4a74f3448a1db5763e455eb9 v0.8.1.tar.gz +eb65657b29dede7737d13c3c34b8f08d docker.rc +5969bb91ec4f17aa381831046fb15531 v0.9.0.tar.gz diff --git a/docker/Pkgfile b/docker/Pkgfile index 02759bdec..712837d03 100644 --- a/docker/Pkgfile +++ b/docker/Pkgfile @@ -1,14 +1,13 @@ # 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 +# Depends on: go bridge-utils sqlite3 name=docker -version=0.8.1 -revision=a1598d1e1c -release=2 +version=0.9.0 +revision=2b3fdf2344 +release=1 source=( https://github.com/dotcloud/$name/archive/v$version.tar.gz $name.rc diff --git a/docker/README b/docker/README index 5f524a48f..d11694b11 100644 --- a/docker/README +++ b/docker/README @@ -1,59 +1,26 @@ Kernel Requirements =================== +If you want to have a full working CRUX+Docker system you will need to rebuild your kernel various networking, cgroups and optional lvm options -If you want to have a full working CRUX+Docker system you will need to rebuild your kernel with the following options enabled: +Please review the provided ``test_kernel_config.sh`` shell script carefully and use this to test your kernel configuration. This README does not document +what these specific options are to vaoid duplication. They are listed instead in ``test_kernel_config.sh``. -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: +You may check your kernel configuration by running: :: ./test_kernel_config.sh /usr/src/linux/.config -Other Requirements -================== +Execution Engines +================= +As of Docker 0.9+ execution engines are pluggable and as such Docker no longer depends on lxc. +The new default execution driver is now an internal ``libcontainer`` driver that replaces the need for lxc. -You **must** have the following ``cgroup`` mount point mounted: +Please see the `Docker Documentation `_ if you want to use a different execution engine other then the default. -:: - - none /cgroup cgroup defaults 0 0 - Storage Backends ================ @@ -76,6 +43,4 @@ To use the ``btrfs`` backend edit ``/etc/docker.conf`` and modify the ``DOCKER_O 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. +Add yourself to the ``docker`` group if you wish to access the Docker daemon on localhost via UNIX Socker. diff --git a/docker/docker.rc b/docker/docker.rc index bfd10b774..2b30603ed 100755 --- a/docker/docker.rc +++ b/docker/docker.rc @@ -7,10 +7,24 @@ 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 - chmod 660 /var/run/docker.sock + # Ensure ownership and permissiong of log file. + touch /var/log/docker.log + chgrp docker /var/log/docker.log + chown 640 /var/log/docker.log + + # Ensure cgroups is properly mounted. (Taken from: https://github.com/dotcloud/docker/blob/v0.9.0/contrib/init/sysvinit-debian/docker#L57-L66) + if ! grep -q cgroup /proc/mounts; then + # rough approximation of cgroupfs-mount + mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup + for sys in $(cut -d' ' -f1 /proc/cgroups); do + mkdir -p /sys/fs/cgroup/$sys + if ! mount -n -t cgroup -o $sys cgroup /sys/fs/cgroup/$sys 2>/dev/null; then + rmdir /sys/fs/cgroup/$sys 2>/dev/null || true + fi + done + fi + + nohup /usr/bin/docker $DOCKER_OPTS > /var/log/docker.log 2>&1 & ;; stop) if [ -f /var/run/docker.pid ]; then