Fix spring boot smoke test image on jdk8 (#8102)

We need to help `jib` detect the java version used to get a working jdk8
image.
This commit is contained in:
Lauri Tulmin 2023-03-21 23:56:02 +02:00 committed by GitHub
parent 195fd38c2c
commit aa2b853d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -30,6 +30,13 @@ val targetJDK = project.findProperty("targetJDK") ?: "11"
val tag = findProperty("tag")
?: DateTimeFormatter.ofPattern("yyyyMMdd.HHmmSS").format(LocalDateTime.now())
java {
// needed by jib to detect java version used in project
// for jdk9+ jib uses an entrypoint that doesn't work with jdk8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
jib {
from.image = "openjdk:$targetJDK"
to.image = "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk$targetJDK-$tag"