gpt4 book ai didi

spring-boot - Spring Boot 2.3.0 bootBuildImage 失败

转载 作者:行者123 更新时间:2023-12-04 11:33:47 25 4
gpt4 key购买 nike

我已经更新了我的项目以使用 springboot 2.3.0 并尝试使用默认的 springboot gradle 任务 bootBuildImage 构建 docker 镜像。

该项目是一个简单的休息项目,分为两部分:-接口(interface)定义和接口(interface)实现。所有这一切都是在我使用 Dockerfile 构建镜像的同时,但我正在尝试尝试新功能。

我没有更改任何配置,也没有添加任何自定义。我只是作为普通的 Vanilla 任务,但遇到以下问题。

DAREYOURDREAM-96TZ:tm-provisioning dareyourdream$ gradle bootBuildImage --scan
Picked up _JAVA_OPTIONS: -Xms1024m -Xmx8192m -XX:MaxPermSize=1024m
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0

> Task :bootBuildImage
Building image 'docker.io/library/tm-provisioning:0.0.1-SNAPSHOT'

> Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' ..................................................
> Pulled builder image 'gcr.io/paketo-buildpacks/builder@sha256:200fb7945ef0f4a3c79befb1262fd592f54ba7b7ffcc8a37716434dd11d0e5e9'
> Pulling run image 'gcr.io/paketo-buildpacks/run:base-cnb' ..................................................
> Pulled run image 'gcr.io/paketo-buildpacks/run@sha256:f7f27462fb513a70370322ada08440a642d24a700056d4c6b8cbb344610bf486'
> Executing lifecycle version v0.7.5
> Using build cache volume 'pack-cache-defc64ac2d6d.build'

> Running creator
[creator] ---> DETECTING
[creator] 5 of 15 buildpacks participating
[creator] paketo-buildpacks/bellsoft-liberica 2.7.1
[creator] paketo-buildpacks/executable-jar 1.2.5
[creator] paketo-buildpacks/apache-tomcat 1.1.5
[creator] paketo-buildpacks/dist-zip 1.3.2
[creator] paketo-buildpacks/spring-boot 1.5.5
[creator] ---> ANALYZING
[creator] Previous image with name "docker.io/library/tm-provisioning:0.0.1-SNAPSHOT" not found
[creator] Skipping buildpack layer analysis
[creator] ---> BUILDING
[creator]
[creator] Paketo BellSoft Liberica Buildpack 2.7.1
[creator] Set $BPL_JVM_HEAD_ROOM to configure the headroom in memory calculation. Default 0.
[creator] Set $BPL_JVM_LOADED_CLASS_COUNT to configure the number of loaded classes in memory calculation. Default 35% of classes.
[creator] Set $BPL_JVM_THREAD_COUNT to configure the number of threads in memory calculation. Default 250.
[creator] Set $BP_JVM_VERSION to configure the Java version. Default 11.*.
[creator] BellSoft Liberica JRE 8.0.252: Contributing to layer
[creator] Downloading from https://github.com/bell-sw/Liberica/releases/download/8u252+9/bellsoft-jre8u252+9-linux-amd64.tar.gz
[creator] Verifying checksum
[creator] Expanding to /layers/paketo-buildpacks_bellsoft-liberica/jre
[creator] Writing env.launch/JAVA_HOME.override
[creator] Writing env.launch/MALLOC_ARENA_MAX.override
[creator] Writing profile.d/active-processor-count.sh
[creator] Memory Calculator 4.0.0: Contributing to layer
[creator] Downloading from https://github.com/cloudfoundry/java-buildpack-memory-calculator/releases/download/v4.0.0/memory-calculator-4.0.0.tgz
[creator] Verifying checksum
[creator] Expanding to /layers/paketo-buildpacks_bellsoft-liberica/memory-calculator
[creator] Writing profile.d/memory-calculator.sh
[creator] Class Counter: Contributing to layer
[creator] Copying to /layers/paketo-buildpacks_bellsoft-liberica/class-counter
[creator] JVMKill Agent 1.16.0: Contributing to layer
[creator] Downloading from https://github.com/cloudfoundry/jvmkill/releases/download/v1.16.0.RELEASE/jvmkill-1.16.0-RELEASE.so
[creator] Verifying checksum
[creator] Copying to /layers/paketo-buildpacks_bellsoft-liberica/jvmkill
[creator] Writing env.launch/JAVA_OPTS.append
[creator] Link-Local DNS: Contributing to layer
[creator] Copying to /layers/paketo-buildpacks_bellsoft-liberica/link-local-dns
[creator] Writing profile.d/link-local-dns.sh
[creator] Java Security Properties: Contributing to layer
[creator] Writing env.launch/JAVA_OPTS.append
[creator] Writing env.launch/JAVA_SECURITY_PROPERTIES.override
[creator] Security Providers Configurer: Contributing to layer
[creator] Copying to /layers/paketo-buildpacks_bellsoft-liberica/security-providers-configurer
[creator] Writing profile.d/security-providers-classpath.sh
[creator] Writing profile.d/security-providers-configurer.sh
[creator] OpenSSL Certificate Loader: Contributing to layer
[creator] Copying to /layers/paketo-buildpacks_bellsoft-liberica/openssl-security-provider
[creator] Writing profile.d/openssl-certificate-loader.sh
[creator]
[creator] Paketo Executable JAR Buildpack 1.2.5
[creator] Writing env.launch/CLASSPATH
[creator] Process types:
[creator] executable-jar: java -cp "${CLASSPATH}" ${JAVA_OPTS} org.springframework.boot.loader.JarLauncher
[creator] task: java -cp "${CLASSPATH}" ${JAVA_OPTS} org.springframework.boot.loader.JarLauncher
[creator] web: java -cp "${CLASSPATH}" ${JAVA_OPTS} org.springframework.boot.loader.JarLauncher
[creator]
[creator] Paketo Spring Boot Buildpack 1.5.5
[creator] Image labels:
[creator] org.springframework.boot.spring-configuration-metadata.json
[creator] org.springframework.boot.version
[creator] ---> EXPORTING
[creator] ERROR: failed to create launch cache: removing backup directory '/launch-cache/committed-backup': unlinkat /launch-cache/committed-backup/sha256:476cb0263a8f538fc72cbbe6bcbe70e08129d22a953b966115cb866d942e2b33.tar: permission denied

> Task :bootBuildImage FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootBuildImage'.
> Builder lifecycle 'creator' failed with status code 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 45s
2 actionable tasks: 2 executed

最佳答案

那似乎是 build cache related (构建缓存已损坏)。您的构建日志显示使用的构建缓存:

...
> Executing lifecycle version v0.7.5
> Using build cache volume 'pack-cache-defc64ac2d6d.build'
由于 Spring Boot Gradle 插件(与 spring-boot-maven-plugin 相同)是 Paketo.io 的抽象它是 pack CLI , 正在使用 Docker对于本地构建,您应该能够找到构建缓存卷 pack-cache-defc64ac2d6d.build和:
docker volume ls
这给出了类似的东西:
$ docker volume ls
DRIVER VOLUME NAME
local bellsoft-jre-config
local pack-cache-defc64ac2d6d.build
local pack-cache-defc64ac2d6d.launch
local spring-cloud-config
现在单独删除构建缓存( docker volume rm pack-cache-defc64ac2d6d.build ) - 或者简单地删除其他容器未使用的所有本地 Docker 卷:
docker volume prune
现在您的构建应该再次运行。

关于spring-boot - Spring Boot 2.3.0 bootBuildImage 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61995733/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com