Skip to content
Snippets Groups Projects
Commit 9d778806 authored by nimrod's avatar nimrod
Browse files

Better use ONBUILD.

parent 2a979970
No related branches found
No related tags found
No related merge requests found
Pipeline #986 passed
...@@ -16,4 +16,5 @@ USER nobody ...@@ -16,4 +16,5 @@ USER nobody
CMD [ "supersonic", "/crontab" ] CMD [ "supersonic", "/crontab" ]
HEALTHCHECK CMD pgrep supersonic HEALTHCHECK CMD pgrep supersonic
RUN supersonic -test /crontab RUN supersonic -test /crontab
ONBUILD COPY crontab /crontab
ONBUILD RUN supersonic -test /crontab ONBUILD RUN supersonic -test /crontab
...@@ -18,13 +18,13 @@ FROM alpine:latest ...@@ -18,13 +18,13 @@ FROM alpine:latest
COPY --from=supersonic /usr/local/bin/supersonic /usr/local/bin/ 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 The other pattern is building on top of this image to run some periodic tasks.
like so: 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 FROM registry.shore.co.il/cron
RUN apk add --update --no-cache aws-cli RUN apk add --update --no-cache aws-cli
COPY crontab /crontab
COPY script /usr/local/bin/ COPY script /usr/local/bin/
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment