[FIX]Fix overlayfs problem with tail and cron via docker VOLUMES

This commit is contained in:
Fabien BOURGEOIS 2017-11-21 10:30:09 +01:00
parent 9b3d10a27e
commit 8f8de4cbf0
4 changed files with 9 additions and 5 deletions

View File

@ -7,9 +7,11 @@ ENV DEST /var/backups/
RUN apt-get update && apt-get install --no-install-recommends -y \ RUN apt-get update && apt-get install --no-install-recommends -y \
cron gettext-base rsync python-minimal libpython-stdlib cron gettext-base rsync python-minimal libpython-stdlib
# Avoid overlayfs bug with tail
VOLUME /var/log
COPY crontab /etc/crontab COPY crontab /etc/crontab
RUN chmod 644 /etc/crontab RUN chmod 644 /etc/crontab
RUN touch /var/log/cron.log
WORKDIR /opt/backup WORKDIR /opt/backup
COPY rsync.template . COPY rsync.template .

View File

@ -2,4 +2,4 @@
envsubst < /opt/backup/rsync.template > /opt/backup/rsync.sh envsubst < /opt/backup/rsync.template > /opt/backup/rsync.sh
envsubst < /opt/backup/plan.tpl.py > /opt/backup/plan.py envsubst < /opt/backup/plan.tpl.py > /opt/backup/plan.py
cron && tail -f /var/log/cron.log touch /var/log/cron.log && cron && tail -f /var/log/cron.log

View File

@ -10,15 +10,17 @@ USER root
RUN mkdir backups RUN mkdir backups
RUN apt-get install -y --no-install-recommends cron gettext-base RUN apt-get install -y --no-install-recommends cron gettext-base
# Avoid overlayfs bug with tail
VOLUME /var/log
COPY crontab /etc/crontab COPY crontab /etc/crontab
RUN chmod 644 /etc/crontab RUN chmod 644 /etc/crontab
RUN touch /var/log/cron.log
COPY backup.template . COPY backup.template .
COPY plan.py . COPY plan.py .
COPY launch.sh . COPY launch.sh .
RUN chown -R odoo:odoo . && chown odoo:odoo /var/log/cron.log RUN chown -R odoo:odoo .
VOLUME /home/odoo/backups VOLUME /home/odoo/backups
CMD bash launch.sh CMD bash launch.sh

View File

@ -2,4 +2,4 @@
envsubst < /home/odoo/backup.template > /home/odoo/backup.sh envsubst < /home/odoo/backup.template > /home/odoo/backup.sh
chown odoo:odoo /home/odoo/backup.sh chown odoo:odoo /home/odoo/backup.sh
cron && tail -f /var/log/cron.log touch /var/log/cron.log && cron && tail -f /var/log/cron.log