Skip to content

Instantly share code, notes, and snippets.

@delvison
Created November 30, 2023 00:04
Show Gist options
  • Save delvison/7a5bdae6f095de89674b3aef372dc6ec to your computer and use it in GitHub Desktop.
Save delvison/7a5bdae6f095de89674b3aef372dc6ec to your computer and use it in GitHub Desktop.
An example of running a cron job in docker compose
---
version: "3"
services:
cron:
container_name: cron
image: alpine:3.6
entrypoint:
- sh
- -euc
- |
cat <<EOF > /etc/crontabs/root
*/1 * * * * echo "hello world"
# MUST end file with newline
EOF
crond -f -d 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment