diff --git a/build.gradle b/build.gradle index 7f67cce3a12..5f34322f77c 100644 --- a/build.gradle +++ b/build.gradle @@ -648,9 +648,14 @@ task distDocker { } exec { def image = "${dockerImageName}:${dockerBuildVersion}-${jvmVariant}" + def dockerPlatform = "" + if (project.hasProperty('docker-platform')){ + dockerPlatform = "--platform ${project.getProperty('docker-platform')}" + println "Building for platform ${project.getProperty('docker-platform')}" + } executable "sh" workingDir dockerBuildDir - args "-c", "docker build --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${getCheckedOutGitCommitHash()} -t ${image} ." + args "-c", "docker build ${dockerPlatform} --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${getCheckedOutGitCommitHash()} -t ${image} ." } }