commit d5bc156b9df421a306d11b7f8366024bb458814b Author: Matt Housh <jaeger@crux.ninja> Date: Mon May 30 23:13:03 2016 -0500 docker: cleaned up, added docker.conf diff --git a/docker/.footprint b/docker/.footprint index 3b6c48d..ec6239d 100644 --- a/docker/.footprint +++ b/docker/.footprint @@ -1,6 +1,7 @@ drwxr-xr-x root/root etc/ drwxr-xr-x root/root etc/bash_completion.d/ -rw-r--r-- root/root etc/bash_completion.d/docker +-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/ diff --git a/docker/.md5sum b/docker/.md5sum index 7b914c5..36f8b0e 100644 --- a/docker/.md5sum +++ b/docker/.md5sum @@ -1,3 +1,4 @@ 2767e2b5098dbf330b1fc08e2105207d docker-1.11.1.tar.xz 8c86c300b3e70144c10797deddf10911 docker-man-pages-1.11.1.tar.xz -fc6ebe7d940298fc737ddb662bcd4219 docker.rc +639d3af72199001bb612e545335a67a3 docker.conf +a5958065f57184ef580fdf3a76d58a07 docker.rc diff --git a/docker/Pkgfile b/docker/Pkgfile index 02e5ae5..5163afd 100644 --- a/docker/Pkgfile +++ b/docker/Pkgfile @@ -5,10 +5,10 @@ name=docker version=1.11.1 -release=3 +release=4 source=(http://jaeger.morpheus.net/linux/crux/files/$name-$version.tar.xz \ http://jaeger.morpheus.net/linux/crux/files/$name-man-pages-$version.tar.xz \ - $name.rc) + $name.rc $name.conf) build() { export AUTO_GOPATH=1 @@ -26,6 +26,8 @@ build() { install -D -m 0755 $SRC/$name.rc \ $PKG/etc/rc.d/$name + install -D -m 0644 $SRC/$name.conf \ + $PKG/etc/$name.conf ln -s containerd $PKG/usr/bin/docker-containerd ln -s containerd-shim $PKG/usr/bin/docker-containerd-shim diff --git a/docker/UPGRADE b/docker/UPGRADE deleted file mode 100644 index 8c608af..0000000 --- a/docker/UPGRADE +++ /dev/null @@ -1,8 +0,0 @@ -Upgrade Notes for Docker 1.6.0 -============================== - -Docker 1.6.0 introduced several new features. - -.. see:: https://blog.docker.com/2015/04/docker-release-1-6/ - -No kernel changes required. diff --git a/docker/docker b/docker/docker deleted file mode 100755 index dc68e3e..0000000 --- a/docker/docker +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# -# /etc/rc.d/docker: start/stop docker daemon -# - -SSD=/sbin/start-stop-daemon -PROG=/usr/bin/docker -PIDFILE=/var/run/docker.pid -LOGFILE=/var/log/docker.log - -. /etc/docker.conf - -case $1 in -start) - # Ensure ownership and permissiong of log file. - touch $LOGFILE - chgrp docker $LOGFILE - chown 640 $LOGFILE - - # Ensure cgroups is properly mounted. - cgroupfs-mount - - $SSD --start --background --make-pidfile --pidfile $PIDFILE --exec $PROG -- daemon $OPTS >> $LOGFILE 2>&1 - ;; -stop) - $SSD --stop --retry 10 --pidfile $PIDFILE - - # Unmount cgroups is - cgroupfs-umount - ;; -restart) - $0 stop - sleep 2 - $0 start - ;; -reload) - $SSD --stop --pidfile $PIDFILE --signal HUP - ;; -status) - $SSD --status --pidfile $PIDFILE - case $? in - 0) echo "$(basename $PROG) is running with pid $(cat $PID)" ;; - 1) echo "$(basename $PROG) is not running but the pid file $PID exists" ;; - 3) echo "$(basename $PROG) is not running" ;; - 4) echo "Unable to determine the program status" ;; - esac - ;; -*) - echo "usage: $0 [start|stop|restart|reload|status]" - ;; -esac - -# End of file diff --git a/docker/docker.conf b/docker/docker.conf index 40d5691..729a803 100644 --- a/docker/docker.conf +++ b/docker/docker.conf @@ -2,6 +2,4 @@ # # For configuration options see: docker daemon --help -OPTS="" - -# vim: syntax=sh +OPTS="-p /var/run/docker.pid -G docker" diff --git a/docker/docker.rc b/docker/docker.rc index 5aa23e1..e52f09d 100755 --- a/docker/docker.rc +++ b/docker/docker.rc @@ -6,12 +6,28 @@ SSD=/sbin/start-stop-daemon PROG=/usr/bin/docker PID=/var/run/docker.pid -OPTS="-p $PID -G docker" +CONF=/etc/docker.conf +LOG=/var/log/docker.log + +if [ -f $CONF ]; then + . $CONF +else + if [ -z $OPTS ]; then + OPTS="-p $PID -G docker" + fi +fi case $1 in start) + if [ ! -f $LOG ]; then + touch $LOG + chgrp docker $LOG + chmod 640 $LOG + fi + /usr/bin/cgroupfs-mount - $SSD --start --pidfile $PID --background --exec $PROG -- daemon $OPTS + + $SSD --start --pidfile $PID --background --exec $PROG -- daemon $OPTS >> $LOG 2>&1 ;; stop) $SSD --stop --retry 10 --pidfile $PID diff --git a/docker/post-install b/docker/post-install deleted file mode 100755 index 1f205cf..0000000 --- a/docker/post-install +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# create docker group -getent group docker > /dev/null || groupadd -g 142 docker