Use openjdk as a default image in DockerJavaApplicationPlugin
MODIFY
README.asciidoc
README.asciidoc
@@ -461,7 +461,7 @@ The plugin defines the following extension properties in the `javaApplication` c
[options="header"]
|=======
|Property name |Type |Default value |Description
-|`baseImage` |String |java |The Docker base image used for Java application.
+|`baseImage` |String |openjdk |The Docker base image used for Java application.
|`exec` |Closure |Create ENTRYPOINT using script from Application plugin |The ENTRYPOINT and/or CMD Dockerfile instructions
|`maintainer` |String |Value of `user.home` system property |The name and email address of the image maintainer.
|`port` |Integer |8080 |The Docker image entry point port used for the Java application (Deprecated)

MODIFY
src/functTest/groovy/com/bmuschko/gradle/docker/DockerJavaApplicationPluginFunctionalTest.groovy
src/functTest/groovy/com/bmuschko/gradle/docker/DockerJavaApplicationPluginFunctionalTest.groovy
@@ -4,7 +4,7 @@ import org.gradle.testkit.runner.BuildResult
import spock.lang.Requires
class DockerJavaApplicationPluginFunctionalTest extends AbstractFunctionalTest {
- public static final CUSTOM_BASE_IMAGE = 'yaronr/openjdk-7-jre'
+ public static final CUSTOM_BASE_IMAGE = 'openjdk:7-alpine'
def "Can create image for Java application with default configuration"() {
String projectName = temporaryFolder.root.name
@@ -19,7 +19,7 @@ class DockerJavaApplicationPluginFunctionalTest extends AbstractFunctionalTest {
File dockerfile = new File(projectDir, 'build/docker/Dockerfile')
dockerfile.exists()
dockerfile.text ==
-"""FROM java
+"""FROM openjdk
MAINTAINER ${System.getProperty('user.name')}
ADD ${projectName} /${projectName}
ADD app-lib/${projectName}-1.0.jar /$projectName/lib/$projectName-1.0.jar

MODIFY
src/main/groovy/com/bmuschko/gradle/docker/DockerJavaApplication.groovy
src/main/groovy/com/bmuschko/gradle/docker/DockerJavaApplication.groovy
*/
package com.bmuschko.gradle.docker
-import com.bmuschko.gradle.docker.tasks.image.Dockerfile
import com.bmuschko.gradle.docker.tasks.image.Dockerfile.CompositeExecInstruction
class DockerJavaApplication {
- String baseImage = 'java'
+ String baseImage = 'openjdk'
final CompositeExecInstruction exec = new CompositeExecInstruction()
String maintainer = System.getProperty('user.name')
@Deprecated

Use openjdk as a default image in DockerJavaApplicationPlugin (#528)