I have a pretty simple Go program that queries a database for rows with some inconsistency according to a business rule, then updates the rows so as to be consistent with the business rule. This is all fine, I can run the program as a binary and it just works. However, I'm also supposed to containerize this program with Docker and have it run every hour.
What I'm not sure of is the best way to get the program to run once an hour. What I'd like to do is use crontab, but I have no idea how to get Docker to interface with it (I am still a Docker noob, and yes, I have read the introductory docs, this is just my first time getting my hands dirty).
Another consideration is to do this within the Go program itself, but I'm not sure if that's an elegant or safe solution considering the requirements I've been given. I'd like for the program to be low-overhead, and that approach seems to imply writing it as a daemon, which seems like overkill.
So is it possible to containerize my simple program, and define the crontab within the Dockerfile somehow, utilizing the host system's crontab? If not, what is the correct approach to this problem?