gradle spring-boot 2.3.0.M3 buildbuilder --builder cloudfoundry / cnb:bionic cache jdk不会在每次运行时下载

问题描述 投票:1回答:1

我有一个spring-boot gradle REST应用,并想创建一个符合OCI的映像与https://buildpacks.io/ pack

pack -v build minimal_rest --builder cloudfoundry/cnb:bionic

在任何执行时,它都将jdk重新下载为“贡献层”

===> BUILDING
[builder]
[builder] Cloud Foundry OpenJDK Buildpack v1.2.14
[builder]   OpenJDK JDK 11.0.6: Contributing to layer
[builder]     Downloading from https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%!B(MISSING)10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz

有没有一种方法可以“缓存”贡献层,以免每次运行都重新下载它们?

plus:

我使用spring-boot-starter-2.3.0.M3和带有org.springframework.boot插件的gradle 6.2.1(也使用v 2.3.0.M3)

通话中

./gradlew clean build -x test bootBuildImage

with

tasks {
    bootJar {
        val archivesBaseName: String by project.extra
        archiveBaseName.set(archivesBaseName)
        manifest {
            attributes["Implementation-Title"] = project.name
            attributes["Implementation-Version"] = v.version
            attributes["provider"] = "gradle"
        }
    }
    bootBuildImage {
        builder = "cloudfoundry/cnb:bionic"
        val archivesBaseName: String by project.extra
        imageName = archivesBaseName
    }
}

我终于明白了:

Execution failed for task ':bootBuildImage'.
> Detected platform API version 'v0.3' is not included in supported versions 'v0.1,v0.2'

但是使用了仅两天(2020年3月20日)的cloudfoundry / cnb:bionic]

也许对此有什么想法吗?

spring-boot gradle containers oci buildpack
1个回答
0
投票

所以我在他们的闲置频道上得到了答案(至少在第一部分中是。)>

[[0]的运行无误后... pack现在会缓存jdk,并且不会在每次运行时都下载jdk。 (确保连续运行时不传递--clear-cache)

同样在项目根目录中,您也可以询问包本身,它“推荐”使用哪些构建器:

--clear-cache
© www.soinside.com 2019 - 2024. All rights reserved.