Initial commit.

master
Icedream 2015-12-23 07:11:54 +01:00
commit ed4c002e7c
2 changed files with 46 additions and 0 deletions

22
Dockerfile Normal file
View File

@ -0,0 +1,22 @@
FROM icedream/debian-armhf:stable
ENV DPMASTER_VERSION "1c1bd46a78d41726f3c1d13cc27e41d2e7620e19"
RUN apt-get update &&\
DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y wget ca-certificates tar make gcc libc6-dev libc6 &&\
apt-mark auto wget ca-certificates tar make gcc libc6-dev &&\
wget -O- https://github.com/kphillisjr/dpmaster/archive/${DPMASTER_VERSION}.tar.gz |\
tar xz -C /tmp &&\
cd /tmp/dpmaster-${DPMASTER_VERSION}/src &&\
make UNIX_EXE=/usr/local/bin/dpmaster release &&\
cd / &&\
adduser --system -u 999 --no-create-home dpmaster &&\
apt-get autoremove --purge -y &&\
apt-get clean &&\
rm -rf /var/tmp/* /tmp/* /var/lib/apt/lists/*
EXPOSE 27950
USER 999
COPY dpmaster-wrapper.sh /usr/local/bin/dpmaster-wrapper
CMD ["dpmaster-wrapper"]

24
dpmaster-wrapper.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# This script makes sure dpmaster exits quickly by reliably proxying
# the SIGTERM coming from Docker on container shutdown.
# trap the sigterm signal
_term() {
# send termination request and wait for process to exit
kill "$child"
wait "$child"
# error code 143 means exit caused by bash's kill request
retval=$?
[ "$retval" -eq 143 ] && retval=0
# any other error code should be forwarded as is
exit $retval
}
trap _term SIGTERM
# start dpmaster
dpmaster &
child=$!
wait "$child"