Skip to content
README.md 1.31 KiB
Newer Older
nimrod's avatar
nimrod committed
# Cron docker

nimrod's avatar
nimrod committed
[![pipeline status](https://git.shore.co.il/nimrod/cron-docker/badges/master/pipeline.svg)](https://git.shore.co.il/nimrod/cron-docker/-/commits/master)

nimrod's avatar
nimrod committed
A Docker image for running a Cron daemon, actually running
[Supersonic](https://github.com/aptible/supercronic).

## Usage

There are possible usage patterns for this image. The first is using it in a
multi-stage image build as the source of the `supersonic` binary to incorporate
in your own image like so:

```
nimrod's avatar
nimrod committed
FROM registry.shore.co.il/cron as supersonic
nimrod's avatar
nimrod committed

FROM alpine:latest
COPY --from=supersonic /usr/local/bin/supersonic /usr/local/bin/
```

nimrod's avatar
nimrod committed
The other pattern is building on top of this image to run some periodic tasks.
The `ONBUILD` commands will copy the crontab file and validate it. Just copy
whatever scripts and install whatever packages you need, like so:
nimrod's avatar
nimrod committed

```
nimrod's avatar
nimrod committed
FROM registry.shore.co.il/cron
nimrod's avatar
nimrod committed
COPY script /usr/local/bin/
nimrod's avatar
nimrod committed
USER root
RUN apk add --update --no-cache aws-cli
USER nobody
nimrod's avatar
nimrod committed
```

## License

This software is licensed under the MIT license (see `LICENSE.txt`).

## Author Information

nimrod's avatar
nimrod committed
Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my
[website](https://www.shore.co.il/). Patches are welcome via
[`git send-email`](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository
nimrod's avatar
nimrod committed
is located at: <https://git.shore.co.il/explore/>.