Skip to content

Instantly share code, notes, and snippets.

@allanlei
Last active January 7, 2019 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allanlei/5b3607a28dda0a7a469aef23da6482c3 to your computer and use it in GitHub Desktop.
Save allanlei/5b3607a28dda0a7a469aef23da6482c3 to your computer and use it in GitHub Desktop.
Running cron in Docker via compiled image
FROM alpine
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# run: docker run -it --rm IMAGE "* * * * * echo hello"
#!/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