SOLR-14949: Adding githubUrl option for docker build. (#2074)

This commit is contained in:
Houston Putman 2020-11-10 13:31:33 -05:00 committed by GitHub
parent 863a388fe7
commit d65041359e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -37,6 +37,11 @@ Base Docker Image: (The docker image used for the "FROM" in the Solr Dockerfile)
EnvVar: SOLR_DOCKER_BASE_IMAGE
Gradle Property: -Psolr.docker.baseImage
Github URL or Mirror: (The URL of github or a mirror of github releases. This is of use when building the docker image behind a firewall that does not have access to external Github.)
Default: "github.com"
EnvVar: SOLR_DOCKER_GITHUB_URL
Gradle Property: -Psolr.docker.githubUrl
Testing
-------

View File

@ -38,11 +38,12 @@ def dockerImageRepo = propertyOrEnvOrDefault("solr.docker.imageRepo", "SOLR_DOCK
def dockerImageTag = propertyOrEnvOrDefault("solr.docker.imageTag", "SOLR_DOCKER_IMAGE_TAG", "${version}")
def dockerImageName = propertyOrEnvOrDefault("solr.docker.imageName", "SOLR_DOCKER_IMAGE_NAME", "${dockerImageRepo}:${dockerImageTag}")
def baseDockerImage = propertyOrEnvOrDefault("solr.docker.baseImage", "SOLR_DOCKER_BASE_IMAGE", 'openjdk:11-jre-slim')
def githubUrlOrMirror = propertyOrEnvOrDefault("solr.docker.githubUrl", "SOLR_DOCKER_GITHUB_URL", 'github.com')
docker {
name = dockerImageName
files file('include')
buildArgs(['BASE_IMAGE' : baseDockerImage, '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}", 'GITHUB_URL': githubUrlOrMirror])
}
tasks.docker {