diff --git a/Dockerfile b/Dockerfile index 8cf17129b4948b98ddb1736d80ac59b8ed44d964..b7cbbbe6378901e3e9bb341dc4ebe4205eea49d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,4 +16,5 @@ USER nobody CMD [ "supersonic", "/crontab" ] HEALTHCHECK CMD pgrep supersonic RUN supersonic -test /crontab +ONBUILD COPY crontab /crontab ONBUILD RUN supersonic -test /crontab diff --git a/README.md b/README.md index d0d9f87a1dda668e4cfb15c1501ed47ab529f884..d6bf2a46b0682e6a121ba00ee539bd6201e34654 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,16 @@ FROM alpine:latest COPY --from=supersonic /usr/local/bin/supersonic /usr/local/bin/ ``` -The other pattern is building on top of this image to run some periodic tasks -like so: +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: ``` FROM registry.shore.co.il/cron -RUN apk add --update --no-cache aws-cli -COPY crontab /crontab COPY script /usr/local/bin/ +USER root +RUN apk add --update --no-cache aws-cli +USER nobody ``` ## License