Docker image that runs a command with a specified delay
2.0K
A simple Docker image that repeatedly runs a command with a specified delay.
| Name | Required | Default value | Example value | Description |
|---|---|---|---|---|
COMMAND | Yes | echo Hello | ||
AFTER_COMMAND | No | echo Hello after | Command that should be executed after COMMAND | |
RETRIES | No | 0 | 3 | Number of times to retry COMMAND after a nonzero exit code. Retries stop immediately after a successful attempt. |
RETRY_BACKOFF | No | 0 | 5 | Initial retry delay in seconds. The delay doubles after each failed attempt (5 seconds, then 10, then 20, and so on). |
DELAY | No | 1d | 7d (or any other permissible value for the sleep command) | |
ADJUST_FOR_RUNTIME | No | true | false | If set to true, subtracts the execution time of the task from the delay, ensuring the scheduler runs at consistent intervals (e.g., the same time each day). |
CHECK_LAST_RUNTIME | No | false | true | If set to true, checks when the task last ran and waits if needed to ensure the specified delay has passed since the last execution. |
LAST_RUNTIME_FILE | No | /tmp/last_runtime | /var/log/last_runtime | File to store the timestamp of the last execution when CHECK_LAST_RUNTIME is enabled. |
HEALTHCHECKS_URL | No | https://hc-ping.com/your-uuid | If set, sends ping to healthchecks.io before and after each command attempt (success or fail). |
See this project for an example of how to use this image as your base docker image.
Content type
Image
Digest
sha256:6c59c1a18…
Size
9.3 MB
Last updated
4 days ago
docker pull stevenmassaro/recurring-task-base