Closed dvallin closed 6 years ago
We decided to include a Dockerfile instead of using the DSL
task buildDocker(type: Docker) {
dockerfile = 'Dockerfile'
version = versionDetails().gitHash
applicationName = rootProject.name.toLowerCase()
entryPoint(['java', '-jar', "${jar.archiveName}"])
addFile {
from jar
}
}
with a Dockerfile as simple as
FROM openjdk:9-jre
now it works with even with targetCompatibility = 9
Same error with any JDK > 8
We decided to include a Dockerfile instead of using the DSL
task buildDocker(type: Docker) { dockerfile = 'Dockerfile' version = versionDetails().gitHash applicationName = rootProject.name.toLowerCase() entryPoint(['java', '-jar', "${jar.archiveName}"]) addFile { from jar } }
with a Dockerfile as simple as
FROM openjdk:9-jre
now it works with even with
targetCompatibility = 9
This works fine!!!!
Thanks
In our gradle file we have (among lots of other things)
running
./gradlew buildDocker
gives an error messageThis would be the expected behavior for not configuring a baseImage. But if we set the targetCompatibility to 1.8 the image builds fine with:
So the baseImage is picked up after all!
See pull request https://github.com/Transmode/gradle-docker/pull/128