| I agree completely with all you said however Claude solved a problem I had recently in a pretty surprising way. So I’m not very experienced with Docker and can just about make a Docker Compose file. I wanted to setup cron as a container in order to run something on a volume shared with another container. I googled “docker compose cron” and must have found a dozen cron images. I set one up and it worked great on X86 and then failed on ARM because the image didn’t have an ARM build. This is a recurring theme with Docker and ARM but not relevant here I guess. Anyway, after going through those dozen or so images all of which don’t work on ARM I gave up and sent the Compose file to Claude and asked it to suggest something. It suggested simply use the alpine base image and add an entry to its crontab, and it works perfectly fine. This may well be a skill issue but it had never occurred to me to me that cron is still available like that. Three pages of Google results and not a single result anywhere suggesting I should just do it that way. Of course this is also partly because Google search is mostly shit these days. |
You want to schedule things. What is the basic tool we use to schedule on Linux? Cron. Do you need to install it separately? No, it usually comes with most Linux images. What is your container, functionally speaking? A working Linux system. So you can run scripts on it. Lot of these scripts run binaries that come with Linux. Is there a cron binary available? Try using that.
Of course, hindsight is 20/20 but breaking objectives down to their basic core can be helpful.