Skip to content

Commit 0b155d3

Browse files
committed
chore: jib multiplatform container build fixes.
1 parent 0bb18ea commit 0b155d3

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

backend/jvm/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jib {
4242
os = "linux"
4343
}
4444
platform {
45-
architecture = "arm64"
45+
architecture = "amd64"
4646
os = "linux"
4747
}
4848
}

backend/native/build.gradle.kts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.github.ajalt.mordant.rendering.TextColors
44
import com.google.cloud.tools.jib.api.buildplan.ImageFormat
55
import com.google.cloud.tools.jib.gradle.extension.nativeimage.JibNativeImageExtension
6+
import common.Platform
67
import common.githubRepo
78
import common.githubUser
89
import org.gradle.internal.os.OperatingSystem
@@ -58,6 +59,10 @@ jib {
5859
// image = "gcr.io/distroless/base-debian12"
5960
image = "debian:stable-slim"
6061
platforms {
62+
platform {
63+
architecture = "arm64"
64+
os = "linux"
65+
}
6166
platform {
6267
architecture = "amd64"
6368
os = "linux"
@@ -127,12 +132,16 @@ tasks {
127132
onlyIf { OperatingSystem.current().isMacOsX }
128133
}
129134

130-
// Use LinuxX64 for container image
131-
val linkReleaseExecutableLinuxX64 by getting(KotlinNativeLink::class)
132135
val prepareJib by
133136
registering(Copy::class) {
134-
// from(linkReleaseExecutableLinuxArm64)
135-
from(linkReleaseExecutableLinuxX64)
137+
// DefaultNativePlatform.getCurrentArchitecture()
138+
val containerReleaseExecutable =
139+
when {
140+
Platform.isAmd64 -> named("linkReleaseExecutableLinuxX64")
141+
else -> named("linkReleaseExecutableLinuxArm64")
142+
}
143+
144+
from(containerReleaseExecutable)
136145
// Jib native image extension expects the native image to be in "native/nativeCompile"
137146
into(layout.buildDirectory.dir("native/nativeCompile"))
138147
rename { appBinName }

gradle/build-logic/src/main/kotlin/plugins/kotlin.docs.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ tasks {
9595
remoteLineSuffix = "#L"
9696
}
9797

98+
samples.from("src/test/kotlin")
99+
98100
perPackageOption {
99101
matchingRegex = ".*internal.*"
100102
suppress = true

0 commit comments

Comments
 (0)