Dive into this repository to unlock the secrets of running basic cron jobs inside a Docker container. All it takes is few minutes and few simple steps.
Embrace the power of Dockerized Cron Jobs! ๐๐
1๏ธโฃ Build the image defined on Dockerfile:
docker build -t cron-container .
2๏ธโฃ Run the container using the docker-compose.yaml file:
docker compose up cron
You will have your container reading everytime the content of the file the cron is writing, so if you are patient. In one minute you will see the results:
As well, as the cron is writting into the stdout and stderr of the container you can see the 'Hello World' checking the container logs:
docker compose up -d cron
docker logs cron-container
Or inside the container file:
docker exec cron-container tail -f /var/log/cron.log