A minimal Docker image based on Alpine Linux with curl for cronjobs
Create a docker-compose.yml with:
version: '3'
services:
cronjobs:
restart: unless-stopped
image: razvanstoica/cronjobs:3
container_name: <your container name goes here>
volumes:
- ./crontabs/root:/etc/crontabs/root
Put your cronjobs in ./crontabs/root file.
Run it with docker-compose up
command.
Set the output to /dev/stdout
in order to view the cron result.
Example: * * * * * curl -s4 ifconfig.co > /dev/stdout
.
Read all the logs with docker logs <your container name goes here>
.
In order to persist the logs you can add a new volume like this:
version: '3'
services:
cronjobs:
restart: unless-stopped
image: razvanstoica/cronjobs:3
container_name: <your container name goes here>
volumes:
- ./crontabs/root:/etc/crontabs/root
- ./log:/var/log/
Set the output to /var/log/<your log file name goes here>
in order to view the cron result.
Example: * * * * * curl -s4 ifconfig.co > /var/log/<your log file name goes here>
Feel free to contribute.
Same as Alpine Linux.
This project is licensed under the MIT License - see the LICENSE file for detail
- Razvan Stoica - Initial work
See also the list of contributors who participated in this project.
See the full change log here.