ofelia
ofelia copied to clipboard
Feature request: one-time task specified by other container config
This is different from a "job-executed-on-new-container" - I sorely miss functionality analogous to systemd Type=oneshot, which would only run once, when container starts.
The situation I need it for is as following: Upon first start, a container needs to register itself with another service. In my case, the state of the registration is stored in the container's filesystem, i.e. even if such container restarts, it won't have to register again. This one-time task will be attempted until successfully completed, with a specified number of retries and a delay between retries.
Now, some might find a useful feature to run a task once upon each start of the container, which is different from the above, but can share the implementation. I suppose the way to differentiate between the two is to analyze docker events related to the container.