I am transitioning a build system to use Docker as the “glue” at the highest level, to integrate builds of components that don’t use Gradle at a local level. To achieve this, I am using custom tasks, specifying task inputs and outputs via decorated task methods, and using the Gradle build cache. This works fantastically for anything that’s producing files.
Where I just realized this breaks down is when the output of a component build is a Docker image. I want to treat that Docker image as a task output, track it as a task input, and use in the Gradle build cache just like every other file. However, there’s no file for these images; they only exists as entities within Docker.
There are some plugins out there to deal with Docker, but looking at them quickly, their focus is on building Docker images. Are there any recommendations on integrating Docker images with custom tasks to allow for up-to-date calculations and use in the Gradle build cache?