Skip to content

Commit 3eb65d5

Browse files
authored
Merge pull request #185 from RobinScout/v3
Upgrade Supercronic and add SUPERCRONIC_OPTIONS variable
2 parents a20374e + 80aa3f6 commit 3eb65d5

File tree

7 files changed

+44
-10
lines changed

7 files changed

+44
-10
lines changed

Dockerfile.slim.apache

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,13 @@ ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_sele
351351
# |
352352
# | Supercronic is a drop-in replacement for cron (for containers).
353353
# |
354+
ENV SUPERCRONIC_OPTIONS=
354355

355356
ONBUILD ARG INSTALL_CRON
356357
ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \
357-
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \
358+
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-amd64 \
358359
&& SUPERCRONIC=supercronic-linux-amd64 \
359-
&& SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 \
360+
&& SUPERCRONIC_SHA1SUM=5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85 \
360361
&& curl -fsSLO "$SUPERCRONIC_URL" \
361362
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
362363
&& chmod +x "$SUPERCRONIC" \

Dockerfile.slim.cli

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,13 @@ ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_sele
256256
# |
257257
# | Supercronic is a drop-in replacement for cron (for containers).
258258
# |
259+
ENV SUPERCRONIC_OPTIONS=
259260

260261
ONBUILD ARG INSTALL_CRON
261262
ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \
262-
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \
263+
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-amd64 \
263264
&& SUPERCRONIC=supercronic-linux-amd64 \
264-
&& SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 \
265+
&& SUPERCRONIC_SHA1SUM=5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85 \
265266
&& curl -fsSLO "$SUPERCRONIC_URL" \
266267
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
267268
&& chmod +x "$SUPERCRONIC" \

Dockerfile.slim.fpm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,13 @@ ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_sele
279279
# |
280280
# | Supercronic is a drop-in replacement for cron (for containers).
281281
# |
282+
ENV SUPERCRONIC_OPTIONS=
282283

283284
ONBUILD ARG INSTALL_CRON
284285
ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \
285-
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \
286+
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-amd64 \
286287
&& SUPERCRONIC=supercronic-linux-amd64 \
287-
&& SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 \
288+
&& SUPERCRONIC_SHA1SUM=5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85 \
288289
&& curl -fsSLO "$SUPERCRONIC_URL" \
289290
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
290291
&& chmod +x "$SUPERCRONIC" \

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Below is a list of extensions available in this image:
146146

147147
**Enabled by default (in addition to extensions enabled in Slim image):** apcu mysqli pdo_mysql igbinary redis soap
148148

149-
**Available (can be enabled using environment variables):** amqp ast bcmath blackfire bz2 calendar dba ds enchant ev event exif mailparse msgpack gd gettext gmp gnupg igbinary imagick imap intl ldap mcrypt memcached mongodb pcntl pcov pdo_dblib pdo_pgsql pdo_sqlite pgsql pspell shmop snmp sockets sqlite3 swoole tidy uploadprogress weakref(-beta) xdebug xmlrpc xsl yaml
149+
**Available (can be enabled using environment variables):** amqp ast bcmath blackfire bz2 calendar dba ds enchant ev event exif mailparse msgpack gd gettext gmp gnupg igbinary imagick imap intl ldap mcrypt memcached mongodb pcntl pcov pdo_dblib pdo_pgsql pdo_sqlite pgsql pspell shmop snmp sockets sqlite3 swoole tidy weakref(-beta) xdebug xmlrpc xsl yaml
150150

151151
**Note**:
152152

@@ -460,6 +460,21 @@ CRON_SCHEDULE_1=0 1 * * *
460460
CRON_COMMAND_1=vendor/bin/console do:stuff
461461
```
462462

463+
### Supercronic options
464+
To specify Supercronic options you can set the `SUPERCRONIC_OPTIONS` environment variable.
465+
466+
This can be used to enable duplicate jobs. Per default, Supercronic will wait for a given job to finish before that job is scheduled again.\
467+
With the option `-overlapping` Supercronic will run duplicate instances of the jobs instead of waiting for them.
468+
469+
```bash
470+
SUPERCRONIC_OPTIONS=-overlapping
471+
472+
# Or multiple options
473+
SUPERCRONIC_OPTIONS=-overlapping -debug
474+
```
475+
476+
For more options see see the [Supercronic Documentation](https://github.com/aptible/supercronic/blob/master/README.md).
477+
463478
## Launching commands on container startup
464479

465480
You can launch commands on container startup using the `STARTUP_COMMAND_XXX` environment variables.

utils/Dockerfile.slim.blueprint

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,13 @@ ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_sele
383383
# |
384384
# | Supercronic is a drop-in replacement for cron (for containers).
385385
# |
386+
ENV SUPERCRONIC_OPTIONS=
386387

387388
ONBUILD ARG INSTALL_CRON
388389
ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \
389-
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \
390+
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-amd64 \
390391
&& SUPERCRONIC=supercronic-linux-amd64 \
391-
&& SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 \
392+
&& SUPERCRONIC_SHA1SUM=5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85 \
392393
&& curl -fsSLO "$SUPERCRONIC_URL" \
393394
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
394395
&& chmod +x "$SUPERCRONIC" \

utils/README.blueprint.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,21 @@ CRON_SCHEDULE_1=0 1 * * *
415415
CRON_COMMAND_1=vendor/bin/console do:stuff
416416
```
417417

418+
### Supercronic options
419+
To specify Supercronic options you can set the `SUPERCRONIC_OPTIONS` environment variable.
420+
421+
This can be used to enable duplicate jobs. Per default, Supercronic will wait for a given job to finish before that job is scheduled again.\
422+
With the option `-overlapping` Supercronic will run duplicate instances of the jobs instead of waiting for them.
423+
424+
```bash
425+
SUPERCRONIC_OPTIONS=-overlapping
426+
427+
# Or multiple options
428+
SUPERCRONIC_OPTIONS=-overlapping -debug
429+
```
430+
431+
For more options see see the [Supercronic Documentation](https://github.com/aptible/supercronic/blob/master/README.md).
432+
418433
## Launching commands on container startup
419434

420435
You can launch commands on container startup using the `STARTUP_COMMAND_XXX` environment variables.

utils/docker-entrypoint-as-root.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ chmod 0644 /tmp/generated_crontab
126126

127127
# If generated_crontab is not empty, start supercronic
128128
if [[ -s /tmp/generated_crontab ]]; then
129-
supercronic /tmp/generated_crontab &
129+
supercronic ${SUPERCRONIC_OPTIONS} /tmp/generated_crontab &
130130
fi
131131

132132
if [[ "$IMAGE_VARIANT" == "apache" ]]; then

0 commit comments

Comments
 (0)