Skip to content

Commit

Permalink
Implement ARM build for native images via QEMU (#66)
Browse files Browse the repository at this point in the history
* [Build] Try ARM64 QEMU based build

* [Build] Try ARM64 QEMU based build

* [Build] Try ARM64 QEMU based build

* [Build] ARM64 QEMU based build
  • Loading branch information
Schaka authored Sep 19, 2024
1 parent 23f267f commit 427d1f1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,23 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Setup QEMU for ARM64 OCI Image
#if: startsWith(github.ref, 'refs/tags/v')
uses: docker/setup-qemu-action@v3
with:
platforms: 'arm64'
env:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build Native ARM64 OCI Image
#if: startsWith(github.ref, 'refs/tags/v')
run: ./gradlew bootBuildImage --publishImage --imagePlatform linux/arm64
env:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
7 changes: 5 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.springframework.boot.gradle.tasks.run.BootRun
plugins {

id("idea")
id("org.springframework.boot") version "3.3.3"
id("org.springframework.boot") version "3.4.0-M2"
id("io.spring.dependency-management") version "1.1.6"
id("com.google.cloud.tools.jib") version "3.4.3"
id("net.nemerosa.versioning") version "3.1.0"
Expand All @@ -25,6 +25,10 @@ plugins {
repositories {
gradlePluginPortal()
mavenCentral()
maven("https://repo.spring.io/snapshot")
maven("https://repo.spring.io/milestone")
maven("https://repo.spring.io/libs-milestone")
maven("https://repo.spring.io/libs-snapshot")
}

dependencies {
Expand Down Expand Up @@ -210,7 +214,6 @@ jib {
)
)


// Exclude all "developmentOnly" dependencies, e.g. Spring devtools.
configurationName.set("productionRuntimeClasspath")
}
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ plugins {
}

repositories {
gradlePluginPortal()
mavenCentral()
maven("https://repo.spring.io/snapshot")
maven("https://repo.spring.io/milestone")
maven("https://repo.spring.io/snapshot")
maven("https://repo.spring.io/milestone")
}

tasks.withType<JavaCompile> {
Expand Down
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
maven("https://repo.spring.io/snapshot")
maven("https://repo.spring.io/milestone")
maven("https://repo.spring.io/libs-milestone")
maven("https://repo.spring.io/libs-snapshot")
}
}

Expand Down

0 comments on commit 427d1f1

Please sign in to comment.