I am trying to build and push my application docker image from my local machine to my docker hub registry with below configuration. But I am getting error stating "Task 'jibPush' not found in root project"
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.0'
id 'io.spring.dependency-management' version '1.1.4'
id 'com.google.cloud.tools.jib' version '3.4.0'
}
group = 'com.learntech'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '17'
}
jib {
from {
image = 'openjdk:17-slim'
}
container {
jvmFlags = ['-Dmy.property=example.value', '-Xms512m', '-Xdebug']
mainClass = 'mypackage.K8sLearningApplication'
ports = ['8080']
//labels = [key1:'value1', key2:'value2']
//format = 'OCI'
}
to {
image = 'k8-learning:latest'
auth {
username = 'userName'
password = 'password'
}
}
}
Build command
./gradlew jibPush
Run
./gradlew jib
. The available tasks arejib
,jibDockerBuild
, andjibBuildTar
.