diff options
| author | 2021-10-24 08:25:03 -0700 | |
|---|---|---|
| committer | 2021-10-24 17:25:03 +0200 | |
| commit | 07e00c7681e5fd9e680cba75125b166b96a96198 (patch) | |
| tree | 724b01fd3e0b135ce56ac2c893f730b5de468973 | |
| parent | c5ab4cea4a773b2d61e2413a955785431517c3ce (diff) | |
Docker: don't add crontab unless needed. (#3927)
Adding the crontab as part of the image build makes it more complicated
to add custom entries to the crontab. Adjusting the image and entrypoint
to make it so that the crontab is only added when CRON_MIN is set
simplifies having a custom crontab.
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | CREDITS.md | 1 | ||||
| -rw-r--r-- | Docker/Dockerfile | 2 | ||||
| -rw-r--r-- | Docker/Dockerfile-Alpine | 2 | ||||
| -rw-r--r-- | Docker/Dockerfile-Newest | 2 | ||||
| -rw-r--r-- | Docker/Dockerfile-Oldest | 2 | ||||
| -rw-r--r-- | Docker/Dockerfile-QEMU-ARM | 2 | ||||
| -rw-r--r-- | Docker/README.md | 15 | ||||
| -rwxr-xr-x | Docker/entrypoint.sh | 3 |
9 files changed, 24 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 071cb8b2c..740b801b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ * Docker: development image `:oldest` is now based on `alpine:3.5` with PHP 7.0.33 and Apache 2.4.35 [#3666](https://github.com/FreshRSS/FreshRSS/pull/3666) * Docker: default image updated to Debian 11 Bullseye with PHP 7.4.21 and Apache 2.4.48 [#3782](https://github.com/FreshRSS/FreshRSS/pull/3782) * Docker: alternative image updated to Alpine 3.14 with PHP 8.0.10 and Apache 2.4.48 [#3715](https://github.com/FreshRSS/FreshRSS/pull/3715) + * Docker: only add the crontab when CRON_MIN is set. * Images on Docker Hub are automatically scanned for software vulnerabilities * UI * New thumbnail and/or summary options for the normal view [#3805](https://github.com/FreshRSS/FreshRSS/pull/3805) diff --git a/CREDITS.md b/CREDITS.md index 1970f303e..7ac366b91 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -150,3 +150,4 @@ People are sorted by name so please keep this order. * [wtoscer](https://github.com/wtoscer): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:wtoscer) * [Yamakuni](https://github.com/Yamakuni): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:Yamakuni), [Web](https://ofanch.me/) * [yzqzss|一座桥在水上](https://github.com/yzqzss): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:yzqzss), [Web](https://blog.othing.xyz/) +* [Zoredache](https://github.com/zoredache): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:zoredache) diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 3dd81f926..c86298b20 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -45,7 +45,7 @@ RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.co touch /var/www/FreshRSS/Docker/env.txt && \ echo "7,37 * * * * . /var/www/FreshRSS/Docker/env.txt; \ su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \ - 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab - + 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /var/www/FreshRSS/Docker/crontab.default ENV COPY_LOG_TO_SYSLOG On ENV COPY_SYSLOG_TO_STDERR On diff --git a/Docker/Dockerfile-Alpine b/Docker/Dockerfile-Alpine index 95ab0c540..3cbe3edf4 100644 --- a/Docker/Dockerfile-Alpine +++ b/Docker/Dockerfile-Alpine @@ -42,7 +42,7 @@ RUN rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \ touch /var/www/FreshRSS/Docker/env.txt && \ echo "27,57 * * * * . /var/www/FreshRSS/Docker/env.txt; \ su apache -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \ - 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab - + 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /var/www/FreshRSS/Docker/crontab.default ENV COPY_LOG_TO_SYSLOG On ENV COPY_SYSLOG_TO_STDERR On diff --git a/Docker/Dockerfile-Newest b/Docker/Dockerfile-Newest index 55fa0db78..892c69a6f 100644 --- a/Docker/Dockerfile-Newest +++ b/Docker/Dockerfile-Newest @@ -42,7 +42,7 @@ RUN rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \ touch /var/www/FreshRSS/Docker/env.txt && \ echo "27,57 * * * * . /var/www/FreshRSS/Docker/env.txt; \ su apache -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \ - 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab - + 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /var/www/FreshRSS/Docker/crontab.default ENV COPY_LOG_TO_SYSLOG On ENV COPY_SYSLOG_TO_STDERR On diff --git a/Docker/Dockerfile-Oldest b/Docker/Dockerfile-Oldest index b54d8bbe7..9762653be 100644 --- a/Docker/Dockerfile-Oldest +++ b/Docker/Dockerfile-Oldest @@ -42,7 +42,7 @@ RUN rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \ touch /var/www/FreshRSS/Docker/env.txt && \ echo "27,57 * * * * . /var/www/FreshRSS/Docker/env.txt; \ su apache -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \ - 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab - + 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /var/www/FreshRSS/Docker/crontab.default ENV COPY_LOG_TO_SYSLOG On ENV COPY_SYSLOG_TO_STDERR On diff --git a/Docker/Dockerfile-QEMU-ARM b/Docker/Dockerfile-QEMU-ARM index 68595f66c..53cc73723 100644 --- a/Docker/Dockerfile-QEMU-ARM +++ b/Docker/Dockerfile-QEMU-ARM @@ -51,7 +51,7 @@ RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.co touch /var/www/FreshRSS/Docker/env.txt && \ echo "17,47 * * * * . /var/www/FreshRSS/Docker/env.txt; \ su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' \ - 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | crontab - + 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" > /var/www/FreshRSS/Docker/crontab.default # Seems needed for arm32v7/ubuntu on Docker Hub RUN update-ca-certificates -f diff --git a/Docker/README.md b/Docker/README.md index 0f3591ba8..c5a6792e3 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -248,6 +248,21 @@ docker run -d --restart unless-stopped --log-opt max-size=10m \ cron -f ``` +#### For the Debian image (default) using a custom cron.d fragment + +This method gives you the most flexibility most flexiblity to +execute various freshrss cli commands. + +```sh +docker run -d --restart unless-stopped --log-opt max-size=10m \ + -v freshrss-data:/var/www/FreshRSS/data \ + -v freshrss-extensions:/var/www/FreshRSS/extensions \ + -v ./freshrss_crontab:/etc/cron.d/freshrss \ + --net freshrss-network \ + --name freshrss_cron freshrss/freshrss \ + cron -f +``` + #### For the Alpine image ```sh diff --git a/Docker/entrypoint.sh b/Docker/entrypoint.sh index 7043cf153..d6cc34506 100755 --- a/Docker/entrypoint.sh +++ b/Docker/entrypoint.sh @@ -20,7 +20,8 @@ if [ -n "$CRON_MIN" ]; then echo "export COPY_SYSLOG_TO_STDERR=$COPY_SYSLOG_TO_STDERR" echo "export FRESHRSS_ENV=$FRESHRSS_ENV" ) >/var/www/FreshRSS/Docker/env.txt - crontab -l | sed -r "\\#FreshRSS#s#^[^ ]+ #$CRON_MIN #" | crontab - + sed </var/www/FreshRSS/Docker/crontab.default \ + -r "s#^[^ ]+ #$CRON_MIN #" | crontab - fi if [ -n "$FRESHRSS_INSTALL" ]; then |
