Compare commits

...

13 Commits

@ -1,13 +1,18 @@
# Snapraid 12.0
FROM alpine:latest
FROM debian:bullseye
RUN apk --update add python3 git smartmontools tzdata && \
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 apt-get update
RUN apt-get install -y python3 git snapraid smartmontools tzdata cron
RUN git clone https://github.com/Chronial/snapraid-runner.git /app/snapraid-runner
RUN chmod +x /app/snapraid-runner/snapraid-runner.py
RUN echo '0 3 * * * /usr/bin/python3 /app/snapraid-runner/snapraid-runner.py -c /config/snapraid-runner.conf' > /etc/crontabs/root
RUN echo '0 3 * * * /usr/bin/python3 /app/snapraid-runner/snapraid-runner.py -c /config/snapraid-runner.conf' > /etc/cron.d/snapraid
# Give execution rights on the cron job
RUN chmod 0644 /etc/cron.d/snapraid
# Apply cron job
RUN crontab /etc/cron.d/snapraid
VOLUME /mnt /config

@ -1,4 +1,4 @@
#!/bin/ash
#!/bin/bash
# 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.
@ -18,10 +18,10 @@ if [ ! -f /config/snapraid-runner.conf ]; then
exit 1
fi
# test if link is made between /etc/snapraid.conf and /config/snapraid.conf, make if not
# 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 -d 6 -c /etc/crontabs -f
/usr/sbin/cron -f

Loading…
Cancel
Save