Skip to content

Commit

Permalink
Moving to simplified code for launching runit
Browse files Browse the repository at this point in the history
  • Loading branch information
Faisal Puthuparackat committed Oct 6, 2015
1 parent 269b27a commit 78ec59d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 363 deletions.
22 changes: 8 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
FROM alpine:3.2

RUN sed -i 's/#rc_sys=""/rc_sys="lxc"/g' /etc/rc.conf

# Networking is setup by Docker
RUN echo 'rc_provide="loopback net"' >> /etc/rc.conf

# Log boot process to /var/log/rc.log
RUN sed -i 's/^#\(rc_logger="YES"\)$/\1/' /etc/rc.conf

ADD my_init /sbin/

RUN mkdir /etc/container_environment \
&& chmod a+x /sbin/my_init && mkdir /etc/service && mkdir /etc/my_init.d && \
ADD start_runit /sbin/
RUN sed -i 's/#rc_sys=""/rc_sys="lxc"/g' /etc/rc.conf && \
echo 'rc_provide="loopback net"' >> /etc/rc.conf && \
sed -i 's/^#\(rc_logger="YES"\)$/\1/' /etc/rc.conf \
mkdir /etc/container_environment &&\
chmod a+x /sbin/my_init && mkdir /etc/service && mkdir /etc/my_init.d && \
echo "http://dl-4.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \
echo "http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk --update upgrade && apk add runit python3 && rm -rf /var/cache/apk/*
apk --update upgrade && apk add runit && rm -rf /var/cache/apk/*

CMD ["/sbin/my_init"]
CMD ["/sbin/start_runit"]
19 changes: 19 additions & 0 deletions example-service.runit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/sh

. /etc/envvars

exec 2>&1
set -e

umask 022


PROGARGS=""
PROGHOME="/"
PROGNAME="/path/to/binary"


export HOME=/root

cd "${PROGHOME}" && exec $PROGNAME $PROGARGS

349 changes: 0 additions & 349 deletions my_init

This file was deleted.

Loading

0 comments on commit 78ec59d

Please sign in to comment.