SOLR-14947: Print out image info after gradle docker task. (#2007)

This commit is contained in:
Houston Putman 2020-10-22 11:30:43 -04:00 committed by GitHub
parent c680a6e061
commit 3bfe9d8ac9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 4 deletions

View File

@ -31,14 +31,26 @@ dependencies {
docker dockerPackage
}
def dockerImageName = "apache/solr:${version}"
def baseDockerImage = 'openjdk:11-jre-slim'
docker {
name = "apache/solr:${version}"
name = dockerImageName
files file('include')
buildArgs(['BASE_IMAGE' : 'openjdk:11-jre-slim', 'SOLR_PACKAGE_IMAGE' : 'apache/solr-build:local-package', 'SOLR_VERSION': "${version}"])
buildArgs(['BASE_IMAGE' : baseDockerImage, 'SOLR_PACKAGE_IMAGE' : 'apache/solr-build:local-package', 'SOLR_VERSION': "${version}"])
}
tasks.docker {
// In order to create the solr docker image, the solr package image must be created first.
tasks.docker.dependsOn(dockerPackage.tasks.docker)
dependsOn(dockerPackage.tasks.docker)
// Print information on the image after it has been created
doLast {
project.logger.lifecycle("Solr Docker Image Created")
project.logger.lifecycle("\tName: $dockerImageName")
project.logger.lifecycle("\tBase Image: $baseDockerImage")
}
}
abstract class DockerTestSuite extends DefaultTask {
private List<String> tests = new ArrayList<>();