FROM alpine # Install required packages RUN apk add --update --no-cache bash dos2unix # Install python/pip #RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python #RUN python3 -m ensurepip --upgrade #ENV PYTHONUNBUFFERED=1 # install any Python requirements used by the jobs #RUN pip3 install colorama # RUN apk update && \ apk add mysql-client logrotate rsync perl nano rsnapshot WORKDIR /usr/scheduler # Copy files COPY jobs/*.* ./jobs/ COPY crontab.* ./ COPY logrotate_backup_html ./ COPY logrotate_backup_sql ./ COPY rsnapshot.conf /etc/ COPY start.sh . # Fix line endings && execute permissions RUN dos2unix crontab.* *.sh jobs/*.* #RUN find . -type f -iname "*.sh" -exec chmod +x #RUN find . -type f -iname "*.py" -exec chmod +x # create cron.log file RUN touch /var/log/cron.log # Run cron on container startup CMD ["./start.sh"]