Use runit instead of runsvdir in container
authorMichael Brown <supermathie@gmail.com>
Thu, 15 May 2014 03:44:52 +0000 (23:44 -0400)
committerMichael Brown <supermathie@gmail.com>
Thu, 15 May 2014 03:44:52 +0000 (23:44 -0400)
* switch to using runit as 'init' as intended
* Update image version to 0.2.2

image/base/Dockerfile
image/base/runit-1 [new file with mode: 0755]
image/base/runit-1.d-cleanup-pids [new file with mode: 0755]
image/base/runit-2 [new file with mode: 0755]
image/discourse/Dockerfile
launcher

index 0acc5dc9f80cc5f13cab8100095bb1029bd1f9d5..604fae5f1405a6fc885728467758841a2ac5d219 100644 (file)
@@ -3,7 +3,7 @@
 # Official repo only has a ppa for postgresql 9.3 at the moment (14/3/2014)
 # When new LTS ships we can upgrade
 
-# VERSION 0.2.0
+# VERSION 0.2.2
 FROM ubuntu:12.04
 
 MAINTAINER Sam Saffron "https://twitter.com/samsaffron"
@@ -48,6 +48,11 @@ RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections &&\
       tar -xvjf jemalloc-3.4.1.tar.bz2 && cd jemalloc-3.4.1 && ./configure && make &&\
       mv lib/libjemalloc.so.1 /usr/lib && cd / && rm -rf /jemalloc &&\
     apt-get -y install runit monit socat &&\
+    mkdir -p /etc/runit/1.d &&\
     apt-get clean &&\
     rm -f /etc/apt/apt.conf.d/40proxy &&\
     locale-gen en_US
+
+ADD runit-1 /etc/runit/1
+ADD runit-1.d-cleanup-pids /etc/runit/1.d/cleanup-pids
+ADD runit-2 /etc/runit/2
diff --git a/image/base/runit-1 b/image/base/runit-1
new file mode 100755 (executable)
index 0000000..e9c842e
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+/bin/run-parts --verbose --exit-on-error /etc/runit/1.d
diff --git a/image/base/runit-1.d-cleanup-pids b/image/base/runit-1.d-cleanup-pids
new file mode 100755 (executable)
index 0000000..cf5c3da
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+/bin/echo "Cleaning stale PID files"
+/bin/rm -f /var/run/*.pid
diff --git a/image/base/runit-2 b/image/base/runit-2
new file mode 100755 (executable)
index 0000000..b3ec10e
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+/usr/bin/runsvdir -P /etc/service
index ae9c1045e478f129741b947ce29e52515c411011..f87713138913db17b618adec768e482fc3d4990b 100644 (file)
@@ -1,4 +1,4 @@
-FROM samsaffron/discourse_base:0.2.1
+FROM samsaffron/discourse_base:0.2.2
 
 MAINTAINER Sam Saffron "https://twitter.com/samsaffron"
 
index cd9ccbd3a1c0614e048816882e2ccbf1b44c2d68..462915f2361295045e9cd9a09cd3abca1c040a9f 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -13,7 +13,7 @@ config_file=containers/"$config".yml
 cidfile=cids/"$config".cid
 cidbootstrap=cids/"$config"_boostrap.cid
 local_discourse=local_discourse
-image=samsaffron/discourse:0.2.1
+image=samsaffron/discourse:0.2.2
 docker_path=`which docker.io || which docker`
 
 docker_ip=`/sbin/ifconfig | \
@@ -259,7 +259,7 @@ run_start(){
        fi
 
        $docker_path run "${env[@]}" -h "`hostname`-$config" -e DOCKER_HOST_IP=$docker_ip --name $config -t --cidfile $cidfile $ports \
-                  -d $volumes $local_discourse/$config /usr/bin/runsvdir -P /etc/service
+                  -d $volumes $local_discourse/$config /sbin/runit
 
        exit 0
      else