Slackbot
09/25/2023, 9:14 AMNiels Doucet
09/25/2023, 9:34 AMRashid
09/25/2023, 9:35 AMNiels Doucet
09/25/2023, 9:35 AMRashid
09/25/2023, 9:35 AMRashid
09/25/2023, 9:35 AMNiels Doucet
09/25/2023, 9:37 AM--stacktrace
might give more details on the actual error.Rashid
09/25/2023, 9:37 AMNiels Doucet
09/25/2023, 9:37 AMRashid
09/25/2023, 9:38 AMRashid
09/25/2023, 9:40 AMroot@Testing:~/PostmanCollectionToOAS# ./gradlew buildDockerLatest --stacktrace
FAILURE: Build failed with an exception.
* Where:
Build file '/root/PostmanCollectionToOAS/build.gradle' line: 35
* What went wrong:
A problem occurred evaluating root project 'PostmanCollectionToOAS'.
> com.palantir.gradle.docker.DockerExtension_Decorated cannot be cast to java.lang.Class
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'PostmanCollectionToOAS'.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:92)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:204)
at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.ClassCastException: com.palantir.gradle.docker.DockerExtension_Decorated cannot be cast to java.lang.Class
at org.gradle.api.internal.project.taskfactory.TaskFactory.createTask(TaskFactory.java:73)
Rashid
09/25/2023, 9:41 AMNiels Doucet
09/25/2023, 9:42 AM* Where:
Build file '/root/PostmanCollectionToOAS/build.gradle' line: 35
It mentions a specific line, so that might help you debug the problem?Rashid
09/25/2023, 9:43 AMNiels Doucet
09/25/2023, 10:06 AMtask buildDockerLatest(type: docker)
<-- I think you have the type wrong here. You're trying to use the plugin's extension as the type for your task.
The plugin itself uses the Exec
task type in order to create docker images: https://github.com/palantir/gradle-docker/blob/0.34.0/src/main/groovy/com/palantir/gradle/docker/PalantirDockerPlugin.groovy#L69-L73Niels Doucet
09/25/2023, 10:08 AMRashid
09/25/2023, 10:09 AMRashid
09/25/2023, 10:10 AMVampire
09/25/2023, 12:53 PMRashid
09/25/2023, 4:08 PMRashid
09/25/2023, 4:43 PMFAILURE: Build failed with an exception.
* Where:
Build file '/home/osboxes/testing/build.gradle' line: 29
* What went wrong:
A problem occurred evaluating root project 'testing'.
> Could not set unknown property 'plugin' for root project 'testing' of type org.gradle.api.Project.
Rashid
09/25/2023, 4:44 PMbuildscript {
repositories {
maven {
url = uri("<https://plugins.gradle.org/m2/>")
}
}
dependencies {
classpath("com.bmuschko:gradle-docker-plugin:9.3.3")
}
}
apply(plugin = "com.bmuschko.docker-remote-api")
//apply plugin: 'docker'
task buildDockerLatest(type: docker) {
push = false
tag = 'abc/demo'
tagVersion = "latest"
dockerfile = file('Dockerfile')
doFirst {
copy {
from '.'
into 'build/docker'
exclude "gradle"
exclude "gradlew"
exclude "gradlew.bat"
exclude "build"
exclude "build.gradle"
exclude "Dockerfile"
}
}
}
task wrapper (type:Wrapper) {
gradleVersion = '4.5' //we want gradle 2.10 to run this project
}
Vampire
09/25/2023, 4:46 PMapply(...)
anyway, but use the plugins { ... }
block to apply plugins in almost all cases.Vampire
09/25/2023, 4:47 PMRashid
09/25/2023, 4:47 PMVampire
09/25/2023, 4:47 PMRashid
09/25/2023, 4:48 PMRashid
09/25/2023, 4:48 PMRashid
09/25/2023, 4:48 PMVampire
09/25/2023, 4:49 PMVampire
09/25/2023, 4:49 PMThis plugin requires Gradle >= 7.4.0 to work properly.
Rashid
09/25/2023, 4:49 PMRashid
09/25/2023, 4:50 PMRashid
09/25/2023, 4:51 PMRashid
09/25/2023, 4:52 PMVampire
09/25/2023, 4:52 PMVampire
09/25/2023, 4:53 PMRashid
09/25/2023, 4:54 PMVampire
09/25/2023, 4:58 PMRashid
09/25/2023, 4:59 PMVampire
09/25/2023, 4:59 PMRashid
09/25/2023, 4:59 PMRashid
09/27/2023, 10:11 AM./gradlew docker
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':docker'.
> A problem occurred starting process 'command 'docker''
here is new build.gradle file
buildscript {
// ext {
// springBootVersion = SPRING_BOOT_VERSION
//}
repositories {
mavenCentral()
maven {
url "<https://plugins.gradle.org/m2/>"
// url '<https://repo.spring.io/libs-milestone>'
}
}
dependencies {
// classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
// classpath('se.transmode.gradle:gradle-docker:1.2')
classpath "com.palantir.gradle.docker:gradle-docker:0.34.0"
}
}
apply plugin: 'com.palantir.docker'
//apply plugin: 'docker'
//tasks.named("dockerPrepare").configure { dependsOn("bootJar") }
docker {
// tasks.docker.dependsOn('build')
name "abc/test:latest"
files '*'
dockerfile file('Dockerfile')
tag 'DockerHub', "abc/tesing:${getNightly()}"
}
task wrapper (type:Wrapper) {
gradleVersion = '4.5' //we want gradle 2.10 to run this project
}
Vampire
09/27/2023, 10:16 AMdocker
and expectes that you have it in your PATH
which you do not.