FROM oraclelinux:7
LABEL maintainer="Yaltik - Fabien Bourgeois <fabien@yaltik.com>"

ENV SOURCE="/var/lib/docker/volumes" DEST="/var/backups/"

RUN yum -y install gettext rsync ssh cronie && \
      yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
      yum --enablerepo=epel -y install sshpass && \
      yum clean all

# Avoid overlayfs bug with tail
VOLUME /var/log

WORKDIR /opt/backup
COPY crontab ./crontab
COPY rsync.template .
COPY plan.py .
COPY remote.py .
COPY launch.c7.sh launch.sh

CMD ["bash", "launch.sh"]
