Initial push

master
Xavier Garcia 8 years ago
parent e5afb74642
commit ac28428b93

@ -0,0 +1,15 @@
FROM alpine:latest
RUN apk --update add python git && \
apk add snapraid --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing --allow-untrusted && \
git clone https://github.com/Chronial/snapraid-runner.git /app/snapraid-runner && \
chmod +x /app/snapraid-runner/snapraid-runner.py && \
rm -rf /var/cache/apk/*
RUN echo '0 3 * * * root /usr/bin/python /app/snapraid-runner/snapraid-runner.py -c /config/snapraid-runner.conf' > /etc/crontabs/root
VOLUME /mnt /config
COPY /docker-entry.sh /
CMD ["/docker-entry.sh"]

@ -0,0 +1,27 @@
#!/bin/ash
# Ensures that configuration files for both SnapRAID and snapraid-runner are present
# in /config. In reality, both files should be edited manually before running this
# container to ensure correct operation.
# test for /etc/snapraid.conf being a file and not a link, delete if file.
if [ ! -L /etc/snapraid.conf ] && [ -f /etc/snapraid.conf ]; then
rm /etc/snapraid.conf
fi
# test if snapraid.conf is in /config, copy from /defaults/snapraid.conf.example if not.
if [ ! -f /config/snapraid.conf ]; then
echo "No config found. You must configure SnapRAID before running this container."
exit 1
fi
if [ ! -f /config/snapraid-runner.conf ]; then
echo "No config found. You must configure snapraid-runner before running this container"
exit 1
fi
# test if link is made between /etc/snapraid.conf and /config/snapraid.conf, make if not
if [ ! -L /etc/snapraid.conf ]; then
ln -s /config/snapraid.conf /etc/snapraid.conf
fi
/usr/sbin/crond -c /etc/crontabs -f
Loading…
Cancel
Save