I am attempting to containerize a spring boot application that is using Gradle 6.9 and JVM 1.8. I can build on my local machine; however, when I attempt to build within the container I get this error:
Plugin [id: 'com.gorylenko.gradle-git-properties', version: '1.4.15'] was not found in any of the following sources: 4.220 4.220 - Gradle Core Plugins (plugin is not in 'org.gradle' namespace) 4.220 - Plugin Repositories (could not resolve plugin artifact 'com.gorylenko.gradle-git-properties:com.gorylenko.gradle-git-properties.gradle.plugin:1.4.15') 4.220 Searched in the following repositories: 4.221 Gradle Central Plugin Repository
Local project info:
Gradle 6.9
Build time: 2021-05-07 07:28:53 UTC
Revision: afe2e24ababc7b0213ccffff44970aa18035fc0e
Kotlin: 1.4.20
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_402 (Amazon.com Inc. 25.402-b08)
OS: Windows 11 10.0 amd64
Container project info:
Gradle 6.9
Build time: 2021-05-07 07:28:53 UTC
Revision: afe2e24ababc7b0213ccffff44970aa18035fc0e
Kotlin: 1.4.20
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_292 (AdoptOpenJDK 25.292-b10)
OS: Linux 5.15.133.1-microsoft-standard-WSL2 amd64
I attempted to use various gradle images with different jdks as well as using a jdk8 base image and manually installing Gradle.
It looks like Gradle is not able to download the JARs of the plugins. Check that you are giving your Docker container proper network access. I think this is a Docker problem and not a Gradle problem.
Try adding
--network host
do your docker run command.