gradle-docker icon indicating copy to clipboard operation
gradle-docker copied to clipboard

No signature of method: build_8uxeoxw0v35xxabibl49jhru8.docker()

Open ranadeeppalle opened this issue 5 years ago • 3 comments

Below is my build.gradle

plugins { id 'org.springframework.boot' version '2.3.1.RELEASE' id 'io.spring.dependency-management' version '1.0.9.RELEASE' id 'java' id("com.palantir.docker") version "0.25.0" id("com.palantir.docker-run") version "0.25.0" }

apply plugin:"com.palantir.docker"

docker { //line 50 name = "in28min/${project.name}:${version}" tag("name", "in28min/${project.name}:${version}") buildArgs(["name", "${project.name}"]) copySpec.from("build").into("build") pull(true) dockerfile file('Dockerfile') }

dockerRun { name = "${project.name}" image = "in28min/${project.name}:".plus(version) ports("8080:8080") }

AM getting the below error during the gradle build

Build file 'build.gradle' line: 50

A problem occurred evaluating root project 'currency-conversion-service'.

No signature of method: build_8uxeoxw0v35xxabibl49jhru8.docker() is applicable for argument types: (build_8uxeoxw0v35xxabibl49jhru8$_run_closure5) values: [build_8uxeoxw0v35xxabibl49jhru8$_run_closure5@249d76b5]

is this a bug? or am I doing anything wrong?

ranadeeppalle avatar Jul 01 '20 22:07 ranadeeppalle

Having same problem

Levvy055 avatar Nov 17 '20 13:11 Levvy055

Same here, any solution ?

ldesroch avatar Jun 28 '21 19:06 ldesroch

To anyone facing this issue. I ran into this with version 0.30.0.

In the OP's example the type that the name property is resolving to is a GString and not a String. This causes the very cryptic type-error seen above.

Solve this by changing the property name to: project.name instead of: "${project.name}" fixes the issue.

Another related issue occurs when you define: tag 'someTag'. This produces a similar type-error. Solve this by providing an extra empty tag like so: tag 'someTag', '' or, use the deprecated: tags 'someTag'.

As a side-note, both the tag and tags property accept GStrings whereas name does not.

RobertDiebels avatar Oct 25 '21 14:10 RobertDiebels