kopia lustrzana https://github.com/Ovski4/docker-borgbackup-cron
Shamelessely copy mysql Dockerfile entrypoint style
rodzic
3770ad6443
commit
ffbd6ed285
|
@ -18,9 +18,6 @@ RUN pip install PyMySql
|
|||
# Install cron
|
||||
RUN apt-get install -y cron
|
||||
|
||||
COPY entrypoint.sh /var/entrypoint.sh
|
||||
RUN chmod +x /var/entrypoint.sh
|
||||
|
||||
COPY backup_script.sh /var/backup_script.sh
|
||||
RUN chmod +x /var/backup_script.sh
|
||||
|
||||
|
@ -28,4 +25,8 @@ COPY borgbackup_cron /etc/cron.d/borgbackup_cron
|
|||
RUN chmod +x /etc/cron.d/borgbackup_cron
|
||||
RUN crontab /etc/cron.d/borgbackup_cron
|
||||
|
||||
CMD [ "/var/entrypoint.sh" ]
|
||||
COPY entrypoint.sh /var/entrypoint.sh
|
||||
RUN chmod +x /var/entrypoint.sh
|
||||
ENTRYPOINT [ "/var/entrypoint.sh" ]
|
||||
|
||||
CMD ["cron" "-f"]
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
bash set -eo pipefail
|
||||
|
||||
# Add known hosts
|
||||
if [[ -n "$SSH_KNOWN_HOSTS" ]]; then
|
||||
|
@ -35,5 +36,4 @@ fi
|
|||
# Make env variables accessible in crontab
|
||||
declare -p | grep -Ev 'BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID' > /container.env
|
||||
|
||||
echo "Run the crontab in the foreground"
|
||||
cron -f
|
||||
exec "$@"
|
||||
|
|
Ładowanie…
Reference in New Issue