From 23022c1db531aaa3c35ad396201650f3766c8647 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 14 May 2014 23:44:52 -0400 Subject: [PATCH] Use runit instead of runsvdir in container * switch to using runit as 'init' as intended * Update image version to 0.2.2 --- image/base/Dockerfile | 7 ++++++- image/base/runit-1 | 3 +++ image/base/runit-1.d-cleanup-pids | 3 +++ image/base/runit-2 | 2 ++ image/discourse/Dockerfile | 2 +- launcher | 4 ++-- 6 files changed, 17 insertions(+), 4 deletions(-) create mode 100755 image/base/runit-1 create mode 100755 image/base/runit-1.d-cleanup-pids create mode 100755 image/base/runit-2 diff --git a/image/base/Dockerfile b/image/base/Dockerfile index 0acc5dc..604fae5 100644 --- a/image/base/Dockerfile +++ b/image/base/Dockerfile @@ -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 index 0000000..e9c842e --- /dev/null +++ b/image/base/runit-1 @@ -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 index 0000000..cf5c3da --- /dev/null +++ b/image/base/runit-1.d-cleanup-pids @@ -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 index 0000000..b3ec10e --- /dev/null +++ b/image/base/runit-2 @@ -0,0 +1,2 @@ +#!/bin/bash +/usr/bin/runsvdir -P /etc/service diff --git a/image/discourse/Dockerfile b/image/discourse/Dockerfile index ae9c104..f877131 100644 --- a/image/discourse/Dockerfile +++ b/image/discourse/Dockerfile @@ -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" diff --git a/launcher b/launcher index cd9ccbd..462915f 100755 --- 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 -- 2.25.1