/docker-curl-cron

Primary LanguageShellMIT LicenseMIT

lecovi/curl-cron

Docker image that runs periodically runs a curl command

Usage

docker run -d [URL] lecovi/curl-cron

Required Parameters:

  • -e URL=<URL>: curl URL (you can add command options before URL)
  • -e CRON_SCHEDULE="0 1 * * *": specifies when cron job starts (details), e.g. 0 1 * * * (runs every night at 1:00).

Optional parameters:

  • now: run container once and exit (no cron scheduling).

Examples:

Run every hour with cron schedule (container keeps running):

docker run -d \
    -e URL=example.com \
    -e CRON_SCHEDULE="0 1 * * *" \
    lecovi/curl-cron

Run just once (container is deleted afterwards):

docker run --rm \
    -e URL=example.com \
    lecovi/curl-cron now