Skip to content

Failing to Build Image when using buildpacks and environment #347

@bitbaggi

Description

@bitbaggi

Hello,

i have the normal vanilla Spring Boot 3.0.0-RC1 with only org.graalvm.buildtools.native as extra plugin.
You can download it from here Spring Initializr

When i try to build with gradlew bootBuildImage with buildpacks and environment it gives me an exception.

Running creator
    [creator]     Restoring data for SBOM from previous image 
    [creator]     ===> DETECTING                              
    [creator]     ERROR: No buildpack groups passed detection.
    [creator]     ERROR: Please check that you are running against the correct path.
    [creator]     ERROR: failed to detect: no buildpacks participating

My bootBuildImage task is configured in build.gradle:

tasks.named('bootBuildImage') {
    builder = 'docker.io/paketobuildpacks/builder:tiny'
    runImage = 'docker.io/paketobuildpacks/run:tiny-cnb'
    buildpacks = ['gcr.io/paketo-buildpacks/bellsoft-liberica:9.9.0-ea', 'gcr.io/paketo-buildpacks/java-native-image']
    environment = [
            'BP_NATIVE_IMAGE_BUILD_ARGUMENTS': '--verbose'
    ]
}

The --verbose is only a test, i try to add a reflection-config.json to native image

When i remove the environment part from task configuration everything is fine.

plugins {
    id 'org.springframework.boot' version '3.0.0-RC1'
    id 'io.spring.dependency-management' version '1.1.0'
    id 'org.graalvm.buildtools.native' version '0.9.16'
    id 'java'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

repositories {
    mavenCentral()
    maven { url 'https://repo.spring.io/milestone' }
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('bootBuildImage') {
    builder = 'docker.io/paketobuildpacks/builder:tiny'
    runImage = 'docker.io/paketobuildpacks/run:tiny-cnb'
    buildpacks = ['gcr.io/paketo-buildpacks/bellsoft-liberica:9.9.0-ea', 'gcr.io/paketo-buildpacks/java-native-image']
    environment = [
            'BP_NATIVE_IMAGE_BUILD_ARGUMENTS': '--verbose'
    ]
}

tasks.named('test') {
    useJUnitPlatform()
}

Did i anything wrong?
Could i not use environment and buildpacks together?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginvalidThis doesn't seem right

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions