-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving to simplified code for launching runit
- Loading branch information
Faisal Puthuparackat
committed
Oct 6, 2015
1 parent
269b27a
commit 78ec59d
Showing
4 changed files
with
31 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
Oops, something went wrong.