I want to create a Docker image with Gradle and the Jib plugin and bring it to Artifactory. The Docker image should be included in the Artifactory build info.
I can create the Docker image with the Jib Plugin. But how can I get the information about the Docker image into the Artifactory Buildinfo?
The relevant part of my gradle build file:
plugins {
id 'java'
id 'maven-publish'
id "com.google.cloud.tools.jib" version "3.3.2"
id 'com.jfrog.artifactory' version '5.1.6'
}
jib {
from {
image = "myRepo/$myBaseImage"
}
to {
image = "myRepo/myProject:${myTag}"
}
}
artifactory {
contextUrl = 'https://myRepo/artifactory/'
publish {
repository {
repoKey = 'myRepo'
}
clientConfig.info.setBuildNumber(project.version)
defaults {
publications ('ALL_PUBLICATIONS')
publishBuildInfo = true
publishArtifacts = true
}
}
}
By default, after running
gradle jibor actuallygradle jibDockerBuild, you can find theimage digestand theimage IDatbuild/jib-image.digestandbuild/jib-image.idrespectively.Refer: https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin#outputpaths-closure