Last active
January 7, 2019 16:26
-
-
Save allanlei/5b3607a28dda0a7a469aef23da6482c3 to your computer and use it in GitHub Desktop.
Running cron in Docker via compiled image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine | |
COPY entrypoint.sh / | |
RUN chmod +x /entrypoint.sh | |
ENTRYPOINT ["/entrypoint.sh"] | |
# run: docker run -it --rm IMAGE "* * * * * echo hello" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
echo "$1" | crontab - && crond -f -L /dev/stdout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment