Created
November 30, 2023 00:04
-
-
Save delvison/7a5bdae6f095de89674b3aef372dc6ec to your computer and use it in GitHub Desktop.
An example of running a cron job in docker compose
This file contains 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
--- | |
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