Transmode / gradle-docker

A Gradle plugin to build Docker images from the build script.
Apache License 2.0
647 stars 142 forks source link

DockerTasks should use registry from DockerPluginExtension #131

Open pjweisberg opened 6 years ago

pjweisberg commented 6 years ago

DockerTasks have properties that correspond to all the properties in DockerPluginExtension, and it seems to treat all of them as defaults that can be overridden by a specific task, with the exception of registry. Images aren't tagged with the registry URL unless specified in the individual tasks.

registry should be treated the same as the other properties: as a default for the tasks to inherit.

pjweisberg commented 6 years ago

I just realized that getRegistry() does return the "default" value as I expected. The problem is getDefaultImageTag() uses registry directly instead of calling getRegistry().

I can actually work around it by adding this line to my build.gradle:

project.tasks.withType(DockerTask).each { it.registry = it.registry }

There's an evil part of me that's thinking of leaving it in my build file without a comment, as a puzzle for future developers.