mirror of
https://bitbucket.org/shim_/docker-rtm.git
synced 2018-10-04 01:52:08 +02:00
inital
This commit is contained in:
commit
ccc76bf687
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine
|
||||||
|
|
||||||
|
ENV RTM_VERSION 9.4-4
|
||||||
|
ENV RTM_DOWNLOAD_URL "ftp://ftp.ovh.net/made-in-ovh/rtm/install_rtm-0."
|
||||||
|
ENV RTM_INSTALLER_CHECKSUM
|
||||||
|
ENV RTM_REPORT_INTERVAL 60
|
||||||
|
|
||||||
|
RUN apk add --no-cache bash curl sed gawk bind-tools which screen dmidecode pciutils bzip2 perl
|
||||||
|
RUN curl https://github.com/Yelp/dumb-init/releases/download/v1.0.1/dumb-init_1.0.1_amd64 > /usr/bin/dumb-init && \
|
||||||
|
chmod +x /usr/bin/dumb-init
|
||||||
|
|
||||||
|
COPY init.sh /usr/bin/init.sh
|
||||||
|
|
||||||
|
VOLUME /cache
|
||||||
|
|
||||||
|
CMD ["/usr/bin/dumb-init","/usr/bin/init.sh"]
|
26
init.sh
Executable file
26
init.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
$BINARY=/usr/local/rtm/bin/rtm
|
||||||
|
$INSTALLER="/cache/install-$RTM_VERSION.sh"
|
||||||
|
|
||||||
|
function report_loop {
|
||||||
|
while true; do
|
||||||
|
$BINARY
|
||||||
|
sleep $RTM_REPORT_INTERVAL
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -f "$BINARY" ]; then
|
||||||
|
report_loop
|
||||||
|
else
|
||||||
|
curl "$RTM_DOWNLOAD_URL$RTM_VERSION" > $INSTALLER
|
||||||
|
CHECKSUM=$(sha256sum $INSTALLER)
|
||||||
|
if [ "$CHECKSUM" -eq "$RTM_INSTALLER_CHECKSUM $INSTALLER" ]; then
|
||||||
|
chmod +x $INSTALLER
|
||||||
|
$INSTALLER
|
||||||
|
report_loop
|
||||||
|
else
|
||||||
|
echo Checksum mismatch!
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user