I'm new to Docker and I'm exploring ways to use a container for running scheduled tasks, particularly for file maintenance activities. For example, I want to run Exiftool scripts at specific intervals. Is there a way to ensure that both the Exiftool installation and the cron schedule remain persistent even when the container is rebuilt? Would using a bind mount work for this purpose, or is there a better approach?
6 Answers
Look into Google Gemini; it's free and could help you get started. Just be aware that it can come with some clutter.
Check out how Dockerfiles work with Docker Compose. It might simplify your setup significantly.
You might want to try Semaphore. It's primarily a web UI for Ansible playbooks, but it can run shell scripts and allows you to schedule tasks with a cron-like syntax.
I prefer to set up a separate container for cron tasks (or something like containered Quartz) and run Exiftool in a different container. This keeps things organized and simplifies maintenance.
Consider using supercronic with an Alpine-based image. It's specifically designed for running cron jobs inside a container. You’d definitely want to use bind mounts for any necessary files, including your cron configuration.

That's interesting! How do you set up these two separate containers?