Trigger Docker build from upstream image
What I am ultmately trying to do is when one of the upstream images for my dockerfiles (e.g. Ubuntu image on Dockerhub) has been updated, I want to run all of the relevant Docker builds so that they will automatically be updated in production with the latest image fixes.
I suspect this is not easy or possible so then I had another thought for a way this could be achieved. Is it possible to set a trigger that runs e.g. once per month (when MS releases its Docker updates) but only run it if it hasn't already built in the last month?
It wouldn't be the end of the world but I'm not sure I would want to run a build from a code change and then run all of the builds again a day later when an update appears, would rather wait until another month has passed.
Otherwise, it looks like my only option is a simple schedule trigger. Is that correct?
Please sign in to leave a comment.
In order to trigger off of an updated image in a Docker registry, you'd need to be able to base the trigger on a change to a URL. If that is possible, you could try using the URL Build Trigger plugin: https://plugins.jetbrains.com/plugin/9074-url-build-trigger.
Otherwise, we do have a related feature request that you may be interested in: https://youtrack.jetbrains.com/issue/TW-53727. Please consider voting for this feature to show your interest and to be automatically notified of any future updates.
Thanks for the reply, I have voted for the issue. I have recently found out about notifications in docker registry but they don't seem to be configurable on public repositories, only on private ones. I might look at whether I can write my own utility to poll the upstream, look for changes in the image hash and then call a webhook myself.