paketo-buildpacks / spring-boot Goto Github PK
View Code? Open in Web Editor NEWA Cloud Native Buildpack that contributes Spring Boot dependency information and slices an application into multiple layers
License: Apache License 2.0
A Cloud Native Buildpack that contributes Spring Boot dependency information and slices an application into multiple layers
License: Apache License 2.0
Hey there ๐
I have a fairly basic Kotlin Spring Boot 3 Application which has a implementation("org.springframework.boot:spring-boot-starter-web")
dependency and a @RestController
which just returns a String.
If I now run bootBuildImage
I see the following lines
[creator] Web Application Type: Contributing to layer
[creator] Non-web application detected
[creator] Writing env.launch/BPL_JVM_THREAD_COUNT.default
The BPL_JVM_THREAD_COUNT
is then set to 50.
I would have expected it to stay at the default which is 250.
The BPL_JVM_THREAD_COUNT
is set to 250 and the a Servlet web application detected
line in the log.
The buildpack logs Non-web application detected
and sets BPL_JVM_THREAD_COUNT
to 50.
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
@SpringBootApplication
class SpringBuildpacksDemoApplication
fun main(args: Array<String>) {
runApplication<SpringBuildpacksDemoApplication>(*args)
}
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
@RestController()
@RequestMapping("hello")
class HelloController {
@GetMapping
fun getHello(): String{
return "Hello ๐"
}
}
plugins {
id("org.springframework.boot") version "3.0.4"
id("io.spring.dependency-management") version "1.1.0"
kotlin("jvm") version "1.7.22"
kotlin("plugin.spring") version "1.7.22"
}
group = "de.s7g"
version = "0.1"
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
Then run bootBuildImage
and observe the logs/startup of the container.
I am running everything on an Macbook M1 Pro
I was playing around with a minimal Spring Boot 3 web app and compared the build process of bootBuildImage
with a large Spring Boot 2.7.X app.
On the 'older app' the correct application type was detected.
Consider a real world application for example a spring boot application that has external interfaces that require the installation of a client binary or some special OS apt dependencies.
With Dockerfile we can achieve this using COPY and RUN commands but with the defined buildpacks here there does not seem to be a way of achieving this.
So the question is how migration more complex dockerfiles into the spring boot buildpacks?
Seems a significant waste to write your own.
Any ideas?
I have a non-Spring project, but paketo-buildpacks/spring-boot
is still participating
(My apologies if this report is in the wrong project)
I'm trying to build a docker image for my Gradle + Kotlin web server. I don't have any dependency on Spring Boot.
> pack build --builder=paketobuildpacks/builder:base --env "BP_GRADLE_BUILT_MODULE=modules/operator" callhandlergcpoperator:bp
The jar that gets build has a META-INF/MANIFEST.MF
file with one line:
Manifest-Version: 1.0
I don't expect Spring Boot to be involved in a non-Spring project
Spring Boot is marked as participating:
...
===> DETECTING
7 of 18 buildpacks participating
paketo-buildpacks/ca-certificates 2.4.1
paketo-buildpacks/bellsoft-liberica 8.5.0
paketo-buildpacks/gradle 5.6.0
paketo-buildpacks/executable-jar 5.2.1
paketo-buildpacks/apache-tomcat 6.2.0
paketo-buildpacks/dist-zip 4.2.1
paketo-buildpacks/spring-boot 4.6.0
...
> pack inspect callhandlergcpoperator:bp
Inspecting image: callhandlergcpoperator:bp
REMOTE:
(not present)
LOCAL:
Stack: io.buildpacks.stacks.bionic
Base Image:
Reference: 3fde25d5dd00c4c2c30ae437953d659ef3b898099ad2b5b7103a0b303cf4604f
Top Layer: sha256:68ddcb152750ec030933e14ab0e4cfd759a97b1d9b4742f7606584d685cc6f71
Run Images:
index.docker.io/paketobuildpacks/run:base-cnb
gcr.io/paketo-buildpacks/run:base-cnb
Buildpacks:
ID VERSION HOMEPAGE
paketo-buildpacks/ca-certificates 2.4.1 https://github.com/paketo-buildpacks/ca-certificates
paketo-buildpacks/bellsoft-liberica 8.5.0 https://github.com/paketo-buildpacks/bellsoft-liberica
paketo-buildpacks/gradle 5.6.0 https://github.com/paketo-buildpacks/gradle
paketo-buildpacks/executable-jar 5.2.1 https://github.com/paketo-buildpacks/executable-jar
paketo-buildpacks/apache-tomcat 6.2.0 https://github.com/paketo-buildpacks/apache-tomcat
paketo-buildpacks/dist-zip 4.2.1 https://github.com/paketo-buildpacks/dist-zip
paketo-buildpacks/spring-boot 4.6.0 https://github.com/paketo-buildpacks/spring-boot
It's a multi-project Gradle project, and the sub-project I want to deploy is in the diretory modules/operator
.
pack
, kpack
, tekton
buildpacks plugin, etc.) are youpack cli version 0.20.0+git-66a4f32.build-2668
paketobuildpacks/builder <none> 06d50806f1c2 41 years ago 756MB
Aside: I know about reproducible builds, but it really sucks to see '41 years ago'. I want to see how old an image is. Is there a way to disable this yet?
pack inspect-builder <builder>
?> pack inspect-builder paketobuildpacks/builder
Inspecting builder: paketobuildpacks/builder
REMOTE:
Description: Ubuntu bionic base image with buildpacks for Java, .NET Core, NodeJS, Go, Python, Ruby, NGINX and Procfile
Created By:
Name: Pack CLI
Version: 0.20.0+git-66a4f32.build-2668
Trusted: No
Stack:
ID: io.buildpacks.stacks.bionic
Lifecycle:
Version: 0.11.4
Buildpack APIs:
Deprecated: (none)
Supported: 0.2, 0.3, 0.4, 0.5, 0.6
Platform APIs:
Deprecated: (none)
Supported: 0.3, 0.4, 0.5, 0.6
Run Images:
index.docker.io/paketobuildpacks/run:base-cnb
gcr.io/paketo-buildpacks/run:base-cnb
Buildpacks:
ID NAME VERSION HOMEPAGE
paketo-buildpacks/apache-tomcat - 6.2.0 https://github.com/paketo-buildpacks/apache-tomcat
paketo-buildpacks/azure-application-insights - 4.7.1 https://github.com/paketo-buildpacks/azure-application-insights
paketo-buildpacks/bellsoft-liberica - 8.5.0 https://github.com/paketo-buildpacks/bellsoft-liberica
paketo-buildpacks/bundle-install - 0.2.4 https://github.com/paketo-buildpacks/bundle-install
paketo-buildpacks/bundler - 0.1.9 https://github.com/paketo-buildpacks/bundler
paketo-buildpacks/ca-certificates - 2.3.2 https://github.com/paketo-buildpacks/ca-certificates
paketo-buildpacks/ca-certificates - 2.4.0 https://github.com/paketo-buildpacks/ca-certificates
paketo-buildpacks/ca-certificates - 2.4.1 https://github.com/paketo-buildpacks/ca-certificates
paketo-buildpacks/conda-env-update - 0.2.2 https://github.com/paketo-buildpacks/conda-env-update
paketo-buildpacks/cpython - 0.7.2 -
paketo-buildpacks/debug - 3.2.1 https://github.com/paketo-buildpacks/debug
paketo-buildpacks/dep - 0.1.1 https://github.com/paketo-buildpacks/dep
paketo-buildpacks/dep-ensure - 0.1.1 https://github.com/paketo-buildpacks/dep-ensure
paketo-buildpacks/dist-zip - 4.2.1 https://github.com/paketo-buildpacks/dist-zip
paketo-buildpacks/dotnet-core - 0.6.0 https://github.com/paketo-buildpacks/dotnet-core
paketo-buildpacks/dotnet-core-aspnet - 0.2.0 https://github.com/paketo-buildpacks/dotnet-core-aspnet
paketo-buildpacks/dotnet-core-runtime - 0.2.0 https://github.com/paketo-buildpacks/dotnet-core-runtime
paketo-buildpacks/dotnet-core-sdk - 0.1.14 https://github.com/paketo-buildpacks/dotnet-core-sdk
paketo-buildpacks/dotnet-execute - 0.4.1 https://github.com/paketo-buildpacks/dotnet-execute
paketo-buildpacks/dotnet-publish - 0.3.0 https://github.com/paketo-buildpacks/dotnet-publish
paketo-buildpacks/encrypt-at-rest - 3.2.1 https://github.com/paketo-buildpacks/encrypt-at-rest
paketo-buildpacks/environment-variables - 3.1.1 https://github.com/paketo-buildpacks/environment-variables
paketo-buildpacks/environment-variables - 3.2.0 https://github.com/paketo-buildpacks/environment-variables
paketo-buildpacks/environment-variables - 3.2.1 https://github.com/paketo-buildpacks/environment-variables
paketo-buildpacks/executable-jar - 5.2.1 https://github.com/paketo-buildpacks/executable-jar
paketo-buildpacks/go - 0.10.0 https://github.com/paketo-buildpacks/go
paketo-buildpacks/go-build - 0.4.1 https://github.com/paketo-buildpacks/go-build
paketo-buildpacks/go-dist - 0.6.0 https://github.com/paketo-buildpacks/go-dist
paketo-buildpacks/go-mod-vendor - 0.3.1 https://github.com/paketo-buildpacks/go-mod-vendor
paketo-buildpacks/google-stackdriver - 3.13.0 https://github.com/paketo-buildpacks/google-stackdriver
paketo-buildpacks/graalvm - 6.4.2 https://github.com/paketo-buildpacks/graalvm
paketo-buildpacks/gradle - 5.6.0 https://github.com/paketo-buildpacks/gradle
paketo-buildpacks/icu - 0.0.102 https://github.com/paketo-buildpacks/icu
paketo-buildpacks/image-labels - 3.1.2 https://github.com/paketo-buildpacks/image-labels
paketo-buildpacks/image-labels - 3.2.0 https://github.com/paketo-buildpacks/image-labels
paketo-buildpacks/image-labels - 3.2.1 https://github.com/paketo-buildpacks/image-labels
paketo-buildpacks/java - 5.13.0 https://github.com/paketo-buildpacks/java
paketo-buildpacks/java-native-image - 5.8.0 https://github.com/paketo-buildpacks/java-native-image
paketo-buildpacks/jmx - 3.2.1 https://github.com/paketo-buildpacks/jmx
paketo-buildpacks/leiningen - 3.3.1 https://github.com/paketo-buildpacks/leiningen
paketo-buildpacks/maven - 5.5.0 https://github.com/paketo-buildpacks/maven
paketo-buildpacks/miniconda - 0.2.1 -
paketo-buildpacks/mri - 0.2.5 https://github.com/paketo-buildpacks/mri
paketo-buildpacks/native-image - 4.3.1 https://github.com/paketo-buildpacks/native-image
paketo-buildpacks/nginx - 0.3.2 https://github.com/paketo-buildpacks/nginx
paketo-buildpacks/node-engine - 0.7.1 https://github.com/paketo-buildpacks/node-engine
paketo-buildpacks/node-engine - 0.7.2 https://github.com/paketo-buildpacks/node-engine
paketo-buildpacks/node-module-bom - 0.1.2 https://github.com/paketo-buildpacks/node-module-bom
paketo-buildpacks/node-run-script - 0.1.0 https://github.com/paketo-buildpacks/node-run-script
paketo-buildpacks/node-start - 0.3.0 https://github.com/paketo-buildpacks/node-start
paketo-buildpacks/nodejs - 0.7.4 https://github.com/paketo-buildpacks/nodejs
paketo-buildpacks/npm-install - 0.4.0 https://github.com/paketo-buildpacks/npm-install
paketo-buildpacks/npm-start - 0.3.0 https://github.com/paketo-buildpacks/npm-start
paketo-buildpacks/passenger - 0.1.1 https://github.com/paketo-buildpacks/passenger
paketo-buildpacks/pip - 0.5.1 -
paketo-buildpacks/pip-install - 0.2.0 -
paketo-buildpacks/pipenv - 0.2.1 -
paketo-buildpacks/pipenv-install - 0.2.3 -
paketo-buildpacks/procfile - 4.2.2 https://github.com/paketo-buildpacks/procfile
paketo-buildpacks/procfile - 4.3.0 https://github.com/paketo-buildpacks/procfile
paketo-buildpacks/procfile - 4.3.1 https://github.com/paketo-buildpacks/procfile
paketo-buildpacks/puma - 0.0.61 https://github.com/paketo-buildpacks/puma
paketo-buildpacks/python - 0.8.0 -
paketo-buildpacks/python-start - 0.6.2 https://github.com/paketo-buildpacks/python-start
paketo-buildpacks/rackup - 0.0.59 https://github.com/paketo-buildpacks/rackup
paketo-buildpacks/rails-assets - 0.2.4 https://github.com/paketo-buildpacks/rails-assets
paketo-buildpacks/rake - 0.0.14 https://github.com/paketo-buildpacks/rake
paketo-buildpacks/ruby - 0.9.0 https://github.com/paketo-buildpacks/ruby
paketo-buildpacks/sbt - 5.5.1 https://github.com/paketo-buildpacks/sbt
paketo-buildpacks/spring-boot - 4.6.0 https://github.com/paketo-buildpacks/spring-boot
paketo-buildpacks/thin - 0.0.54 https://github.com/paketo-buildpacks/thin
paketo-buildpacks/unicorn - 0.0.52 https://github.com/paketo-buildpacks/unicorn
paketo-buildpacks/upx - 1.1.1 https://github.com/paketo-buildpacks/upx
paketo-buildpacks/yarn - 0.4.0 https://github.com/paketo-buildpacks/yarn
paketo-buildpacks/yarn - 0.4.1 https://github.com/paketo-buildpacks/yarn
paketo-buildpacks/yarn-install - 0.4.0 https://github.com/paketo-buildpacks/yarn-install
paketo-buildpacks/yarn-start - 0.2.0 https://github.com/paketo-buildpacks/yarn-start
Detection Order:
โ Group #1:
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #1:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #2:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #3:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #4:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #5:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ Group #6:
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ Group #2:
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #1:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #2:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ Group #3:
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ Group #3:
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #1:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #2:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ Group #3:
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ Group #4:
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #1:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #2:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ Group #3:
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ Group #5:
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #1:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #2:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ โ Group #3:
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected]
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ Group #4:
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ Group #6:
โ โ paketo-buildpacks/[email protected]
โ Group #7:
โ โ paketo-buildpacks/[email protected]
โ โ Group #1:
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ Group #8:
โ โ paketo-buildpacks/[email protected]
โ โ Group #1:
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected]
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ โ paketo-buildpacks/[email protected] (optional)
โ Group #9:
โ paketo-buildpacks/[email protected]
LOCAL:
(not present)
buildpack.yml
,nginx.conf
, etc.)?pack build --builder=paketobuildpacks/builder:base --env "BP_GRADLE_BUILT_MODULE=modules/operator" callhandlergcpoperator:bp
base: Pulling from paketobuildpacks/builder
Digest: sha256:deeb603fef3faa8ef43b04f6d7d284a78a136a0872fcf7d6091f8d5a0a8fecc1
Status: Image is up to date for paketobuildpacks/builder:base
base-cnb: Pulling from paketobuildpacks/run
Digest: sha256:c6e071ac324b948037be8f950199e765a6b9eccce4e0b74f83f38755d528f534
Status: Image is up to date for paketobuildpacks/run:base-cnb
===> DETECTING
7 of 18 buildpacks participating
paketo-buildpacks/ca-certificates 2.4.1
paketo-buildpacks/bellsoft-liberica 8.5.0
paketo-buildpacks/gradle 5.6.0
paketo-buildpacks/executable-jar 5.2.1
paketo-buildpacks/apache-tomcat 6.2.0
paketo-buildpacks/dist-zip 4.2.1
paketo-buildpacks/spring-boot 4.6.0
===> ANALYZING
Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
Restoring metadata for "paketo-buildpacks/bellsoft-liberica:jre" from app image
Restoring metadata for "paketo-buildpacks/bellsoft-liberica:helper" from app image
Restoring metadata for "paketo-buildpacks/bellsoft-liberica:java-security-properties" from app image
Restoring metadata for "paketo-buildpacks/bellsoft-liberica:jdk" from cache
Restoring metadata for "paketo-buildpacks/gradle:application" from cache
Restoring metadata for "paketo-buildpacks/gradle:cache" from cache
===> RESTORING
Restoring data for "paketo-buildpacks/bellsoft-liberica:jdk" from cache
Restoring data for "paketo-buildpacks/gradle:application" from cache
Restoring data for "paketo-buildpacks/gradle:cache" from cache
===> BUILDING
Paketo CA Certificates Buildpack 2.4.1
https://github.com/paketo-buildpacks/ca-certificates
Launch Helper: Reusing cached layer
Paketo BellSoft Liberica Buildpack 8.5.0
https://github.com/paketo-buildpacks/bellsoft-liberica
Build Configuration:
$BP_JVM_TYPE JRE the JVM type - JDK or JRE
$BP_JVM_VERSION 11 the Java version
Launch Configuration:
$BPL_HEAP_DUMP_PATH write heap dumps on error to this path
$BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
$BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
$BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
$JAVA_TOOL_OPTIONS the JVM launch flags
BellSoft Liberica JDK 11.0.12: Reusing cached layer
BellSoft Liberica JRE 11.0.12: Reusing cached layer
Launch Helper: Reusing cached layer
Java Security Properties: Reusing cached layer
Paketo Gradle Buildpack 5.6.0
https://github.com/paketo-buildpacks/gradle
Build Configuration:
$BP_GRADLE_BUILD_ARGUMENTS --no-daemon assemble the arguments to pass to Gradle
$BP_GRADLE_BUILT_ARTIFACT build/libs/*.[jw]ar the built application artifact explicitly. Supersedes $BP_GRADLE_BUILT_MODULE
$BP_GRADLE_BUILT_MODULE modules/operator the module to find application artifact in
Creating cache directory /home/cnb/.gradle
Compiled Application: Contributing to layer
Executing gradlew --no-daemon assemble
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
Type-safe dependency accessors is an incubating feature.
Type-safe project accessors is an incubating feature.
> Configure project :srcBuild
WARNING: Unsupported Kotlin plugin version.
The `embedded-kotlin` and `kotlin-dsl` plugins rely on features of Kotlin `1.5.21` that might work differently than in the requested version `1.5.30`.
> Task :srcBuild:extractPrecompiledScriptPluginPlugins
> Task :srcBuild:generateExternalPluginSpecBuilders
> Task :srcBuild:compilePluginsBlocks
> Task :srcBuild:generateScriptPluginAdapters
> Task :srcBuild:pluginDescriptors
> Task :srcBuild:processResources
> Task :srcBuild:generatePrecompiledScriptPluginAccessors
> Task :srcBuild:configurePrecompiledScriptDependenciesResolver
> Task :srcBuild:compileKotlin
> Task :srcBuild:compileJava NO-SOURCE
> Task :srcBuild:classes
> Task :srcBuild:inspectClassesForKotlinIC
> Task :srcBuild:jar
> Configure project :
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
tagName - v000.000.003-Tanngrisnir
uncool - v0.0.3
defaultDes - 0.0.3
tagName - v000.000.003-Tanngrisnir
uncool - v0.0.3
defaultDes - 0.0.3
> Task :assemble UP-TO-DATE
> Task :modules:operator:compileKotlin
> Task :modules:operator:compileJava NO-SOURCE
> Task :modules:operator:processResources
> Task :modules:operator:classes
> Task :modules:operator:inspectClassesForKotlinIC
> Task :modules:operator:jar
> Task :modules:operator:startScripts
> Task :modules:operator:distTar
> Task :modules:operator:distZip
> Task :modules:operator:assemble
BUILD SUCCESSFUL in 34s
18 actionable tasks: 18 executed
Removing source code
===> EXPORTING
Reusing layer 'paketo-buildpacks/ca-certificates:helper'
Reusing layer 'paketo-buildpacks/bellsoft-liberica:helper'
Reusing layer 'paketo-buildpacks/bellsoft-liberica:java-security-properties'
Reusing layer 'paketo-buildpacks/bellsoft-liberica:jre'
Adding 1/1 app layer(s)
Reusing layer 'launcher'
Reusing layer 'config'
Adding label 'io.buildpacks.lifecycle.metadata'
Adding label 'io.buildpacks.build.metadata'
Adding label 'io.buildpacks.project.metadata'
no default process type
Saving callhandlergcpoperator:bp...
*** Images (e61548ae056a):
callhandlergcpoperator:bp
Reusing cache layer 'paketo-buildpacks/bellsoft-liberica:jdk'
Adding cache layer 'paketo-buildpacks/gradle:application'
Adding cache layer 'paketo-buildpacks/gradle:cache'
Successfully built image callhandlergcpoperator:bp
As far as I see BPL_SPRING_CLOUD_BINDINGS_ENABLED is not considered during build time.
I want to build images without spring-cloud-bindings at all.
It would be great if BPL_SPRING_CLOUD_BINDINGS_ENABLED = false
remove spring-cloud-bindgings from the resulting image.
Gradle configuration:
plugins {
id 'org.springframework.boot' version '2.5.5'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webflux'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
}
test {
useJUnitPlatform()
}
bootBuildImage {
environment = ['BPL_SPRING_CLOUD_BINDINGS_ENABLED' : 'false']
}
Log output for gradle bootBuildImage
:
[creator] Launch Helper: Contributing to layer
[creator] Creating /layers/paketo-buildpacks_spring-boot/helper/exec.d/spring-cloud-bindings
[creator] Spring Cloud Bindings 1.8.0: Contributing to layer
[creator] Downloading from https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.8.0/spring-cloud-bindings-1.8.0.jar
[creator] Verifying checksum
[creator] Copying to /layers/paketo-buildpacks_spring-boot/spring-cloud-bindings
I often demo buildpacks and I have used dive
to show how much smaller the application layer is as compared to the dependencies layer.
It occurred to me that it might be nice to have that info publishe as part of the build log.
Current output:
[INFO] [creator] Paketo Spring Boot Buildpack 5.3.1
[INFO] [creator] https://github.com/paketo-buildpacks/spring-boot
[INFO] [creator] Creating slices from layers index
[INFO] [creator] dependencies
[INFO] [creator] spring-boot-loader
[INFO] [creator] snapshot-dependencies
[INFO] [creator] application
[INFO] [creator] Launch Helper: Reusing cached layer
Potential alternative output:
[INFO] [creator] Paketo Spring Boot Buildpack 5.3.1
[INFO] [creator] https://github.com/paketo-buildpacks/spring-boot
[INFO] [creator] Creating slices from layers index
[INFO] [creator] dependencies 19 MB
[INFO] [creator] spring-boot-loader 242 kB
[INFO] [creator] snapshot-dependencies 0 B
[INFO] [creator] application 9.6 kB
[INFO] [creator] Launch Helper: Reusing cached layer
Warning about SBOM
reported when running bootBuildImage
with spring-boot-gradle-plugin
.
The message is as follows.
Warning: this buildpack is including both old and new format SBOM information, which is an invalid state. To prevent the lifecycle from failing, libcnb is discarding the old SBOM information.
This problem is reproduced at least in versions that refer to Spring Boot Buildpack 5.0.0
.
A project that can reproduce the problem has been pushed as follows.
https://github.com/k163377/spring-boot-build-image-warn-sandbox
The complete log is shown as follows.
17:53:37: Executing 'bootBuildImage'...
> Task :compileKotlin UP-TO-DATE
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :bootJarMainClassName UP-TO-DATE
> Task :bootJar UP-TO-DATE
> Task :bootBuildImage
Building image 'docker.io/library/spring-boot-build-image-warn-sandbox:1.0-SNAPSHOT'
> Pulling builder image 'docker.io/paketobuildpacks/builder:base' ..................................................
> Pulled builder image 'paketobuildpacks/builder@sha256:988d9d956b62d18a828ea9deab5586d5a307becae23c72c76746c8307048d56f'
> Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' ..................................................
> Pulled run image 'paketobuildpacks/run@sha256:b1e8add4fc569e37085342cd05186d17cb81e128ee60fd9fd633337e25ac7808'
> Executing lifecycle version v0.13.0
> Using build cache volume 'pack-cache-3819609661d9.build'
> Running creator
[creator] ===> DETECTING
[creator] 6 of 19 buildpacks participating
[creator] paketo-buildpacks/ca-certificates 3.0.0
[creator] paketo-buildpacks/bellsoft-liberica 9.0.0
[creator] paketo-buildpacks/syft 1.0.0
[creator] paketo-buildpacks/executable-jar 6.0.0
[creator] paketo-buildpacks/dist-zip 5.0.0
[creator] paketo-buildpacks/spring-boot 5.0.0
[creator] ===> ANALYZING
[creator] Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
[creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:jre" from app image
[creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:helper" from app image
[creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:java-security-properties" from app image
[creator] Restoring metadata for "paketo-buildpacks/syft:syft" from cache
[creator] Restoring metadata for "paketo-buildpacks/spring-boot:helper" from app image
[creator] Restoring metadata for "paketo-buildpacks/spring-boot:spring-cloud-bindings" from app image
[creator] Restoring metadata for "paketo-buildpacks/spring-boot:web-application-type" from app image
[creator] ===> RESTORING
[creator] Restoring data for "paketo-buildpacks/syft:syft" from cache
[creator] ===> BUILDING
[creator]
[creator] Paketo CA Certificates Buildpack 3.0.0
[creator] https://github.com/paketo-buildpacks/ca-certificates
[creator] Launch Helper: Reusing cached layer
[creator]
[creator] Paketo BellSoft Liberica Buildpack 9.0.0
[creator] https://github.com/paketo-buildpacks/bellsoft-liberica
[creator] Build Configuration:
[creator] $BP_JVM_TYPE JRE the JVM type - JDK or JRE
[creator] $BP_JVM_VERSION 17.* the Java version
[creator] Launch Configuration:
[creator] $BPL_DEBUG_ENABLED false enables Java remote debugging support
[creator] $BPL_DEBUG_PORT 8000 configure the remote debugging port
[creator] $BPL_DEBUG_SUSPEND false configure whether to suspend execution until a debugger has attached
[creator] $BPL_HEAP_DUMP_PATH write heap dumps on error to this path
[creator] $BPL_JAVA_NMT_ENABLED true enables Java Native Memory Tracking (NMT)
[creator] $BPL_JAVA_NMT_LEVEL summary configure level of NMT, summary or detail
[creator] $BPL_JFR_ARGS configure custom Java Flight Recording (JFR) arguments
[creator] $BPL_JFR_ENABLED false enables Java Flight Recording (JFR)
[creator] $BPL_JMX_ENABLED false enables Java Management Extensions (JMX)
[creator] $BPL_JMX_PORT 5000 configure the JMX port
[creator] $BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
[creator] $BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
[creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[creator] BellSoft Liberica JRE 17.0.1: Contributing to layer
[creator] Downloading from https://github.com/bell-sw/Liberica/releases/download/17.0.1+12/bellsoft-jre17.0.1+12-linux-amd64.tar.gz
[creator] Verifying checksum
[creator] Expanding to /layers/paketo-buildpacks_bellsoft-liberica/jre
[creator] Adding 128 container CA certificates to JVM truststore
[creator] Writing env.launch/BPI_APPLICATION_PATH.default
[creator] Writing env.launch/BPI_JVM_CACERTS.default
[creator] Writing env.launch/BPI_JVM_CLASS_COUNT.default
[creator] Writing env.launch/BPI_JVM_SECURITY_PROVIDERS.default
[creator] Writing env.launch/JAVA_HOME.default
[creator] Writing env.launch/JAVA_TOOL_OPTIONS.append
[creator] Writing env.launch/JAVA_TOOL_OPTIONS.delim
[creator] Writing env.launch/MALLOC_ARENA_MAX.default
[creator] Launch Helper: Reusing cached layer
[creator] Java Security Properties: Reusing cached layer
[creator]
[creator] Paketo Syft Buildpack 1.0.0
[creator] https://github.com/paketo-buildpacks/syft
[creator]
[creator] Paketo Executable JAR Buildpack 6.0.0
[creator] https://github.com/paketo-buildpacks/executable-jar
[creator] Class Path: Contributing to layer
[creator] Writing env/CLASSPATH.delim
[creator] Writing env/CLASSPATH.prepend
[creator] Warning: this buildpack is including both old and new format SBOM information, which is an invalid state. To prevent the lifecycle from failing, libcnb is discarding the old SBOM information.
[creator] Process types:
[creator] executable-jar: java org.springframework.boot.loader.JarLauncher (direct)
[creator] task: java org.springframework.boot.loader.JarLauncher (direct)
[creator] web: java org.springframework.boot.loader.JarLauncher (direct)
[creator]
[creator] Paketo Spring Boot Buildpack 5.0.0
[creator] https://github.com/paketo-buildpacks/spring-boot
[creator] Creating slices from layers index
[creator] dependencies
[creator] spring-boot-loader
[creator] snapshot-dependencies
[creator] application
[creator] Launch Helper: Reusing cached layer
[creator] Spring Cloud Bindings 1.8.0: Reusing cached layer
[creator] Web Application Type: Reusing cached layer
[creator] Warning: this buildpack is including both old and new format SBOM information, which is an invalid state. To prevent the lifecycle from failing, libcnb is discarding the old SBOM information.
[creator] 4 application slices
[creator] Image labels:
[creator] org.springframework.boot.version
[creator] ===> EXPORTING
[creator] Reusing layer 'paketo-buildpacks/ca-certificates:helper'
[creator] Reusing layer 'paketo-buildpacks/bellsoft-liberica:helper'
[creator] Reusing layer 'paketo-buildpacks/bellsoft-liberica:java-security-properties'
[creator] Adding layer 'paketo-buildpacks/bellsoft-liberica:jre'
[creator] Reusing layer 'paketo-buildpacks/executable-jar:classpath'
[creator] Reusing layer 'paketo-buildpacks/spring-boot:helper'
[creator] Reusing layer 'paketo-buildpacks/spring-boot:spring-cloud-bindings'
[creator] Reusing layer 'paketo-buildpacks/spring-boot:web-application-type'
[creator] Reusing 5/5 app layer(s)
[creator] Reusing layer 'launcher'
[creator] Reusing layer 'config'
[creator] Reusing layer 'process-types'
[creator] Adding label 'io.buildpacks.lifecycle.metadata'
[creator] Adding label 'io.buildpacks.build.metadata'
[creator] Adding label 'io.buildpacks.project.metadata'
[creator] Adding label 'org.springframework.boot.version'
[creator] Setting default process type 'web'
[creator] Saving docker.io/library/spring-boot-build-image-warn-sandbox:1.0-SNAPSHOT...
[creator] *** Images (f14191421637):
[creator] docker.io/library/spring-boot-build-image-warn-sandbox:1.0-SNAPSHOT
[creator] Reusing cache layer 'paketo-buildpacks/syft:syft'
Successfully built image 'docker.io/library/spring-boot-build-image-warn-sandbox:1.0-SNAPSHOT'
BUILD SUCCESSFUL in 4m 7s
4 actionable tasks: 1 executed, 3 up-to-date
17:57:44: Execution finished 'bootBuildImage'.
I have a spring-boot WebFlux project, I add the following dependency:
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-tools</artifactId>
</dependency>
and create docker image using:
./mvnw clean spring-boot:build-image
When I run the created image I get this error:
Setting Active Processor Count to 8
Calculating JVM memory based on 3674572K available memory
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx3225867K -XX:MaxMetaspaceSize=141504K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 3674572K, Thread Count: 50, Loaded Class Count: 22569, Headroom: 0%)
Adding 129 container CA certificates to JVM truststore
Spring Cloud Bindings Enabled
Picked up JAVA_TOOL_OPTIONS: -Djava.security.properties=/layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties -agentpath:/layers/paketo-buildpacks_bellsoft-liberica/jvmkill/jvmkill-1.16.0-RELEASE.so=printHeapHistogram=1 -XX:ActiveProcessorCount=8 -XX:MaxDirectMemorySize=10M -Xmx3225867K -XX:MaxMetaspaceSize=141504K -XX:ReservedCodeCacheSize=240M -Xss1M -Dorg.springframework.cloud.bindings.boot.enable=true
19:29:36.203 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.RuntimeException: Failed to init Reactor's debug agent
at org.springframework.boot.reactor.DebugAgentEnvironmentPostProcessor.postProcessEnvironment(DebugAgentEnvironmentPostProcessor.java:52)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:100)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:86)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
at java.base/java.util.ArrayList.forEach(Unknown Source)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:362)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
at com.gfg.sc.filemanager.FileManagerApplication.main(FileManagerApplication.java:17)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:107)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.reactor.DebugAgentEnvironmentPostProcessor.postProcessEnvironment(DebugAgentEnvironmentPostProcessor.java:49)
... 25 common frames omitted
Caused by: java.lang.IllegalStateException: No compatible attachment provider is available
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:602)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:586)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:538)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:515)
at reactor.tools.agent.ReactorDebugAgent.init(ReactorDebugAgent.java:56)
... 30 common frames omitted
If I create the image using the following Dcokerfile
it works fine:
FROM adoptopenjdk/openjdk15
COPY target/*.jar app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
Because Reactor's debug agent
requires the jdk.attach
java module which should be included in the JRE.
I can suggest adding an environment variable $RUN_ON_JDK
or FROM_JDK
which runs the application using JDK instead of JRE.
The optimal case is to detect required java modules and add them to JRE. see
I think It is also related to bellsoft-liberica
If you try to build an image with a Spring Boot Thin Launcher target (thin not fat jar) the Spring Boot BP barfs because it can't find a bill of materials:
[INFO] [creator] Paketo Executable JAR Buildpack 5.3.0
[INFO] [creator] https://github.com/paketo-buildpacks/executable-jar
[INFO] [creator] Class Path: Contributing to layer
[INFO] [creator] Writing env/CLASSPATH.delim
[INFO] [creator] Writing env/CLASSPATH.prepend
[INFO] [creator] Process types:
[INFO] [creator] executable-jar: java org.springframework.boot.loader.wrapper.ThinJarWrapper (direct)
[INFO] [creator] task: java org.springframework.boot.loader.wrapper.ThinJarWrapper (direct)
[INFO] [creator] web: java org.springframework.boot.loader.wrapper.ThinJarWrapper (direct)
[INFO] [creator]
[INFO] [creator] Paketo Spring Boot Buildpack 4.6.0
[INFO] [creator] https://github.com/paketo-buildpacks/spring-boot
[INFO] [creator]
[INFO] [creator] Paketo Spring Boot Buildpack 4.6.0
[INFO] [creator] manifest does not container Spring-Boot-Lib
[INFO] [creator] ERROR: failed to build: exit status 1
I think for compatibility with other bp configuration youโd really want to download all the deps at image build time and include them in the BOM. This would bring us into line with the CF buildpacks as well (which already support thin jars via an additional step during droplet creation).
To download the deps (to ~/.m2/repository
by default) and print the classpath you can just run the jar with --thin.classpath
. Other options are available (e.g. properties file format). See docs here: https://github.com/spring-projects-experimental/spring-boot-thin-launcher
Currently when the Spring Boot buildpack runs, it fully assumes that the output will be a JAR run in a traditional JVM. However, with the advent of GraalVMโs native image AOT, the resulting image could contain not a JAR and JVM but rather a natively- compiled application.
The buildpack should add support for this deployment style by using the Paketo GraalVM Buildpackโs native image substrate VM support and the Spring Graal Native feature.
timestamp echoed by console logs should based on /etc/localtime
or /etc/timezone
i had changed both /etc/localtime
and/etc/timezone
to Asia/Shanghai
, but timestamp printed still used before timezone
create my own runImage and chage timezone like this
apt-get -y install tzdata && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" /etc/timezone
timestamp should be Asia/Shanghai
style
The origin of this issue is #80
Label org.springframework.boot.spring-configuration-metadata.json
was removed for all Spring Boot applications, except for Spring Cloud Data Flow applications. But Spring Cloud Data Flow UI (through Spring Cloud Data Flow Server) doesn't use it. Of course it might be used by other tools and motivation not to remove it completely, because of breaking changes, is understandable, however it's already done for the majority of all Spring Boot applications. On the other hand, getting rid of this particular label doesn't completely solve all potential problems with exceeding metadata size limits.
IMHO, I would delete this label for Spring Cloud Data Flow applications as well.
But it's more important to have some reliable and flexible approach to manage labels creation. The simplest way is to specify exclusion of specific labels on build ("black list").
However, another long label may arise in the future. So it might be a solution of having "white list". The main idea is pretty simple - "If I need a label, I'll add it explicitly to the list and I don't care about other labels". The main advantage here - metadata size is more solid, but there are downsides too.
This buildpack should opt-in to allowing users to disable SBOM generation. In doing so, it should conform to RFC044.
When BP_DISABLE_SBOM is set to true, buildpacks that allow SBOM to be omitted from their output should refrain from generating or attaching an SBOM in their outputs. This would apply to both new (Syft, CycloneDX, and SPDX formats) and old (label) SBOM outputs.
Additionally, when this variable is set to true a buildpack should set an image label of io.paketo.sbom.disabled to true. This label interface would allow downstream consumers of the image to understand that SBOM generation had been explicitly disabled.
SBOM generation can take substantial time. There may also be other reasons for wanting this functionality to be disabled.
Trying to build this project.
OS: Windows 10
Gradle: 6.8.1
Spring Boot: 2.4.2
Paketo Spring Boot Buildpack: 4.0.0
Docker: v.17.03.1-ce-rc1-win3 (10625)
C:\docker version
Client:
Version: 17.03.1-ce-rc1
API version: 1.27
Go version: go1.7.5
Git commit: 3476dbf
Built: Wed Mar 15 20:33:22 2017
OS/Arch: windows/amd64Server:
Version: 17.03.1-ce-rc1
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: 3476dbf
Built: Wed Mar 15 20:28:18 2017
OS/Arch: linux/amd64
Experimental: true
command line:
gradlew bootBuildImage --imageName=ai91/alexamqttbridge
verbose output:
output.txt
Error:
[creator] Spring Cloud Bindings 1.7.0: Contributing to layer [creator] Downloading from https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.0/spring-cloud-bindings-1.7.0.jar [creator] Verifying checksum [creator] Copying to /layers/paketo-buildpacks_spring-boot/spring-cloud-bindings [creator] unable to invoke layer creator [creator] unable to link /layers/paketo-buildpacks_spring-boot/spring-cloud-bindings/spring-cloud-bindings-1.7.0.jar to /workspace/BOOT-INF/lib/spring-cloud-bindings-1.7.0.jar [creator] symlink /layers/paketo-buildpacks_spring-boot/spring-cloud-bindings/spring-cloud-bindings-1.7.0.jar /workspace/BOOT-INF/lib/spring-cloud-bindings-1.7.0.jar: permission denied [creator] ERROR: failed to build: exit status 1
am I missing some configuration, or is it about windows-docker?
Found 3 medium vulnerabilities and many low in the current build for spring boot 3.2.0
I am new to native images and I need support on how to upgrade and install security patches using gradle. Thanks!
These were the 3 medium vulnerabilities found:
CVE-2023-36054
CVE-2023-36054
CVE-2023-36054
Build snapshot:
Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-base:latest' ..................................................
Pulled builder image 'paketobuildpacks/builder-jammy-base@sha256:daa882f4074bfab8671b1d35eb9e92af5a4e1a56d6782d95a130569ce113873b'
Pulling run image 'docker.io/paketobuildpacks/run-jammy-base:latest' ..................................................
Pulled run image 'paketobuildpacks/run-jammy-base@sha256:6a9cba31b4e9ff39f689838a37c58e82a7c07ac7823206522f2c223146a45813'
Executing lifecycle version v0.17.1
Using build cache volume 'pack-cache-9a23ffb0d919.build'
....
What were you attempting to do?
updated the spring boot version to 2.6.4
What did you expect to happen?
What was the actual behavior? Please provide log output, if possible.
getting bellow error when pod is starting
ERROR: failed to launch: determine start command: when there is no default process a command is required
plugins {
id 'org.springframework.boot' version '2.6.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'com.google.cloud.tools.jib' version '3.0.0'
id 'java'
}
group = 'com.wiley.onboarding'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '8'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.6'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'io.projectreactor:reactor-test'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'
//testRuntimeOnly 'org.junit.platform:junit-platform-commons:1.7.0'
implementation 'org.bitbucket.b_c:jose4j:0.6.3'
implementation 'org.springframework.boot:spring-boot-starter-validation'
}
tasks.named('test') {
useJUnitPlatform()
}
What platform (pack
, kpack
, tekton
buildpacks plugin, etc.) are you
using? Please include a version.
buildpacks
auto-build-image:v1.11.0
What buildpacks are you using? Please include versions.
[detector] ======== Output: paketo-buildpacks/[email protected] ========
[detector] pyproject.toml must include [tool.poetry.dependencies.python], see https://python-poetry.org/docs/pyproject/#dependencies-and-dev-dependencies
[detector] err: paketo-buildpacks/[email protected] (1)
[detector] ======== Output: paketo-buildpacks/[email protected] ========
[detector] pyproject.toml must include [tool.poetry.dependencies.python], see https://python-poetry.org/docs/pyproject/#dependencies-and-dev-dependencies
[detector] err: paketo-buildpacks/[email protected] (1)
[detector] 8 of 21 buildpacks participating
[detector] paketo-buildpacks/ca-certificates 3.1.0
[detector] paketo-buildpacks/bellsoft-liberica 9.2.0
[detector] paketo-buildpacks/syft 1.10.0
[detector] paketo-buildpacks/gradle 6.4.1
[detector] paketo-buildpacks/executable-jar 6.1.0
[detector] paketo-buildpacks/apache-tomcat 7.2.0
[detector] paketo-buildpacks/dist-zip 5.2.0
[detector] paketo-buildpacks/spring-boot 5.8.0
What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>
?
Can you provide a sample app or relevant configuration (buildpack.yml
,
nginx.conf
, etc.)?
I don't know how can I increse jvm container total memory.
Would help you apply memory option?
$ docker run MY_APPLICATION:latest
Setting Active Processor Count to 6
WARNING: Container memory limit unset. Configuring JVM for 1G container.
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx400163K -XX:MaxMetaspaceSize=136412K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 1G, Thread Count: 250, Loaded Class Count: 21670, Headroom: 0%)
Adding 127 container CA certificates to JVM truststore
Spring Cloud Bindings Enabled
Picked up JAVA_TOOL_OPTIONS: -Djava.security.properties=/layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties -agentpath:/layers/paketo-buildpacks_bellsoft-liberica/jvmkill/jvmkill-1.16.0-RELEASE.so=printHeapHistogram=1 -XX:ActiveProcessorCount=6 -XX:MaxDirectMemorySize=10M -Xmx400163K -XX:MaxMetaspaceSize=136412K -XX:ReservedCodeCacheSize=240M -Xss1M -Dorg.springframework.cloud.bindings.boot.enable=true
First, I used to gradle bootBuildImage
without any option.
Second, I excute docker run this build image like above command docker run MY_APPLICATION:latest
.
I know jar maed by buildpacks automatically calculate optimal memory setting.
But I can't change this container total memory. (always set 1G container)
And when docker run, I try to set -Xmx2G as java option. But this occup some error. I think that this just set jvm max memory option.
docker run -p 8080:8080 -e JAVA_OPTS='-Xmx4G' MY_APPLICATION:latest
I saw this github page. In this page, I can set total memory but I don't know how can I do this by using gradle bootBuildImage
task.
please help me.
A Spring Kafka app currently OOM out of the box because the XX:MaxDirectMemorySize
is set to 10 Mo and Kafka needs more (cloudfoundry/java-buildpack-memory-calculator#17)
We are packaging spring boot based apps, which also serve static UI content files. Due to the nature of UI dev we now have some apps that have a huge amount of static files that are served via the spring-boot app. Not sure if this is an anti-pattern or not but this situation was the root cause for the outage of some of our K8s nodes.
The reason for this was quite obvious once we have investigated the issue. The buildpack puts the a file listing of the app code as metadata to the resulting image label io.buildpacks.lifecycle.metadata
. As a result of this, the image and later then the K8s pod metadata get quite huge. In our case the image metadata grows to around 3.2MB in size. When we now run multiple such pods on the same K8s node the overall metadata of all pods can get quite huge. And exactly this is the reason for forcing the K8s node to go down.
So, this is my current understanding what leads to this situation:
The K8s kubelet component responsible for retrieving the current state of all containers (part of PLEG) uses gRPC to communicate with the container runtime. This gRPC has a maximum message size of 16MB. If now the metadata of all containers on a node grow beyond this 16MB limit, kubelet can't query the state of its containers any more, finally leading to an unusable K8s node. The error message that we see in this situation is:
... code = ResourceExhausted desc = grpc: trying to send message larger than max (21922673 vs. 16777216)
See here the corresponding K8s issue: kubernetes/kubernetes#63858
A restart of kubelet or even a reboot of the node does not fix this situation, as the containers with the huge overall metadata are still there. The only way to get out of this situation is to manually remove some of the containers started from such a packeto buildpack created image.
From checking the buildpack sources I understand that on
spring-boot/boot/web_application_type.go
Line 38 in d085524
I also see quite a huge amount of on the data on other lables, e.g. io.paketo.stack.packages
. In the end this strategy could be a problem when adding data unconditionally.
I would consider this also to be a security issue, since once could quickly take down a cf-for-k8s cluster.
Push several Spring-Boot applications with an huge amount of static files via CF-for-K8s. All is packed to a single jar file. So I'm doing a cf push -p app.jar
.
The same behavior can be triggered when scaling such an application horizontally.
All pushed applications are running and K8s cluster is in good conditions ;)
Some K8s nodes go out of service (NotReady). Kubelet logs start looking like this
E0511 11:27:39.173420 3892 kuberuntime_container.go:382] getKubeletContainers failed: rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (21922673 vs. 16777216)
E0511 11:27:39.173460 3892 generic.go:205] GenericPLEG: Unable to retrieve pods: rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (21922673 vs. 16777216)
E0511 11:27:40.943159 3892 remote_runtime.go:312] ListContainers with filter &ContainerFilter{Id:,State:nil,PodSandboxId:,LabelSelector:map[string]string{},} from runtime service failed: rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (21922673 vs. 16777216)
E0511 11:27:40.943249 3892 kuberuntime_container.go:382] getKubeletContainers failed: rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (21922673 vs. 16777216)
E0511 11:27:40.943273 3892 generic.go:205] GenericPLEG: Unable to retrieve pods: rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (21922673 vs. 16777216)
E0511 11:27:42.722286 3892 remote_runtime.go:312] ListContainers with filter &ContainerFilter{Id:,State:nil,PodSandboxId:,LabelSelector:map[string]string{},} from runtime service failed: rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (21922673 vs. 16777216)
E0511 11:27:42.722338 3892 kuberuntime_container.go:382] getKubeletContainers failed: rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (21922673 vs. 16777216)
E0511 11:27:42.722352 3892 generic.go:205] GenericPLEG: Unable to retrieve pods: rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (21922673 vs. 16777216)
pack
, kpack
, tekton
buildpacks plugin, etc.) are youlog output of the staging process ...
build
build Paketo CA Certificates Buildpack 2.1.0
build https://github.com/paketo-buildpacks/ca-certificates
build Launch Helper: Contributing to layer
build Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
build
build Paketo BellSoft Liberica Buildpack 7.1.0
build https://github.com/paketo-buildpacks/bellsoft-liberica
build Build Configuration:
build $BP_JVM_VERSION 11 the Java version
build Launch Configuration:
build $BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
build $BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
build $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
build $JAVA_TOOL_OPTIONS the JVM launch flags
build BellSoft Liberica JRE 11.0.10: Contributing to layer
build Downloading from http://cf-buildpack-offline-dependencies-svc.offline-deps:8080/bellsoft-jre11.0.10+9-linux-amd64.tar.gz
build Verifying checksum
build Expanding to /layers/paketo-buildpacks_bellsoft-liberica/jre
build Adding 6 container CA certificates to JVM truststore
build Writing env.launch/BPI_APPLICATION_PATH.default
build Writing env.launch/BPI_JVM_CACERTS.default
build Writing env.launch/BPI_JVM_CLASS_COUNT.default
build Writing env.launch/BPI_JVM_SECURITY_PROVIDERS.default
build Writing env.launch/JAVA_HOME.default
build Writing env.launch/MALLOC_ARENA_MAX.default
build Launch Helper: Contributing to layer
build Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/active-processor-count
build Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/java-opts
build Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/link-local-dns
build Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator
build Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/openssl-certificate-loader
build Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/security-providers-configurer
build Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/security-providers-classpath-9
build JVMKill Agent 1.16.0: Contributing to layer
build Downloading from http://cf-buildpack-offline-dependencies-svc.offline-deps:8080/jvmkill-1.16.0-RELEASE.so
build Verifying checksum
build Copying to /layers/paketo-buildpacks_bellsoft-liberica/jvmkill
build Writing env.launch/JAVA_TOOL_OPTIONS.append
build Writing env.launch/JAVA_TOOL_OPTIONS.delim
build Java Security Properties: Contributing to layer
build Writing env.launch/JAVA_SECURITY_PROPERTIES.default
build Writing env.launch/JAVA_TOOL_OPTIONS.append
build Writing env.launch/JAVA_TOOL_OPTIONS.delim
build
build Paketo Executable JAR Buildpack 5.0.0
build https://github.com/paketo-buildpacks/executable-jar
build Class Path: Contributing to layer
build Writing env/CLASSPATH.delim
build Writing env/CLASSPATH.prepend
build Process types:
build executable-jar: java org.springframework.boot.loader.JarLauncher (direct)
build task: java org.springframework.boot.loader.JarLauncher (direct)
build web: java org.springframework.boot.loader.JarLauncher (direct)
build
build Paketo Spring Boot Buildpack 4.1.0
build https://github.com/paketo-buildpacks/spring-boot
build Launch Helper: Contributing to layer
build Creating /layers/paketo-buildpacks_spring-boot/helper/exec.d/spring-cloud-bindings
build Spring Cloud Bindings 1.7.0: Contributing to layer
build Downloading from http://cf-buildpack-offline-dependencies-svc.offline-deps:8080/spring-cloud-bindings-1.7.0.jar
build Verifying checksum
build Copying to /layers/paketo-buildpacks_spring-boot/spring-cloud-bindings
build Web Application Type: Contributing to layer
build Servlet web application detected
build Writing env.launch/BPL_JVM_THREAD_COUNT.default
build Image labels:
build org.opencontainers.image.title
build org.opencontainers.image.version
build org.springframework.boot.spring-configuration-metadata.json
build org.springframework.boot.version
build stream closed
export Adding layer 'paketo-buildpacks/ca-certificates:helper'
export Adding layer 'paketo-buildpacks/bellsoft-liberica:helper'
export Adding layer 'paketo-buildpacks/bellsoft-liberica:java-security-properties'
export Adding layer 'paketo-buildpacks/bellsoft-liberica:jre'
export Adding layer 'paketo-buildpacks/bellsoft-liberica:jvmkill'
export Adding layer 'paketo-buildpacks/executable-jar:classpath'
export Adding layer 'paketo-buildpacks/spring-boot:helper'
export Adding layer 'paketo-buildpacks/spring-boot:spring-cloud-bindings'
export Adding layer 'paketo-buildpacks/spring-boot:web-application-type'
export Adding 1/1 app layer(s)
export Adding layer 'launcher'
export Adding layer 'config'
export Adding layer 'process-types'
export Adding label 'io.buildpacks.lifecycle.metadata'
export Adding label 'io.buildpacks.build.metadata'
export Adding label 'io.buildpacks.project.metadata'
export Adding label 'org.opencontainers.image.title'
export Adding label 'org.opencontainers.image.version'
export Adding label 'org.springframework.boot.spring-configuration-metadata.json'
export Adding label 'org.springframework.boot.version'
export Setting default process type 'web'
detect 5 of 18 buildpacks participating
detect paketo-buildpacks/ca-certificates 2.1.0
detect paketo-buildpacks/bellsoft-liberica 7.1.0
detect paketo-buildpacks/executable-jar 5.0.0
detect paketo-buildpacks/dist-zip 4.0.0
detect paketo-buildpacks/spring-boot 4.1.0
pack inspect-builder <builder>
?cf-default-builder, with stack: bionic-stack (CF-for-k8s default configuration)
buildpack.yml
,nginx.conf
, etc.)?CF-for-k8s default configuration.
Projects initialized with spring initializer cannot be built with gradle bootBuildImage
Everything works and a docker image is built
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :resolveMainClassName UP-TO-DATE
> Task :processAot UP-TO-DATE
> Task :compileAotJava UP-TO-DATE
> Task :processAotResources UP-TO-DATE
> Task :aotClasses UP-TO-DATE
> Task :collectReachabilityMetadata UP-TO-DATE
> Task :bootJar UP-TO-DATE
> Task :bootBuildImage
Building image 'docker.io/library/pin-api2:0.0.1-SNAPSHOT'
> Executing lifecycle version v0.16.5
> Using build cache volume 'pack-cache-ff3849349d1d.build'
> Running creator
[creator] ===> ANALYZING
[creator] Image with name "docker.io/library/pin-api2:0.0.1-SNAPSHOT" not found
[creator] ===> DETECTING
[creator] 6 of 15 buildpacks participating
[creator] paketo-buildpacks/ca-certificates 3.6.3
[creator] paketo-buildpacks/bellsoft-liberica 10.2.6
[creator] paketo-buildpacks/syft 1.32.1
[creator] paketo-buildpacks/executable-jar 6.7.4
[creator] paketo-buildpacks/spring-boot 5.26.1
[creator] paketo-buildpacks/native-image 5.12.1
[creator] ===> RESTORING
[creator] ===> BUILDING
[creator]
[creator] Paketo Buildpack for CA Certificates 3.6.3
[creator] https://github.com/paketo-buildpacks/ca-certificates
[creator] Launch Helper: Contributing to layer
[creator] Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[creator]
[creator] Paketo Buildpack for BellSoft Liberica 10.2.6
[creator] https://github.com/paketo-buildpacks/bellsoft-liberica
[creator] Build Configuration:
[creator] $BP_JVM_JLINK_ARGS --no-man-pages --no-header-files --strip-debug --compress=1 configure custom link arguments (--output must be omitted)
[creator] $BP_JVM_JLINK_ENABLED false enables running jlink tool to generate custom JRE
[creator] $BP_JVM_TYPE JRE the JVM type - JDK or JRE
[creator] $BP_JVM_VERSION 17 the Java version
[creator] Launch Configuration:
[creator] $BPL_DEBUG_ENABLED false enables Java remote debugging support
[creator] $BPL_DEBUG_PORT 8000 configure the remote debugging port
[creator] $BPL_DEBUG_SUSPEND false configure whether to suspend execution until a debugger has attached
[creator] $BPL_HEAP_DUMP_PATH write heap dumps on error to this path
[creator] $BPL_JAVA_NMT_ENABLED true enables Java Native Memory Tracking (NMT)
[creator] $BPL_JAVA_NMT_LEVEL summary configure level of NMT, summary or detail
[creator] $BPL_JFR_ARGS configure custom Java Flight Recording (JFR) arguments
[creator] $BPL_JFR_ENABLED false enables Java Flight Recording (JFR)
[creator] $BPL_JMX_ENABLED false enables Java Management Extensions (JMX)
[creator] $BPL_JMX_PORT 5000 configure the JMX port
[creator] $BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
[creator] $BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
[creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[creator] Using Java version 17 extracted from MANIFEST.MF
[creator] BellSoft Liberica NIK 17.0.7: Contributing to layer
[creator] Downloading from https://download.bell-sw.com/vm/23.0.0/bellsoft-liberica-vm-core-openjdk17.0.7+7-23.0.0+1-linux-amd64.tar.gz
[creator] Verifying checksum
[creator] Expanding to /layers/paketo-buildpacks_bellsoft-liberica/native-image-svm
[creator] Adding 137 container CA certificates to JVM truststore
[creator] Writing env.build/JAVA_HOME.override
[creator] Writing env.build/JDK_HOME.override
[creator]
[creator] Paketo Buildpack for Syft 1.32.1
[creator] https://github.com/paketo-buildpacks/syft
[creator] Downloading from https://github.com/anchore/syft/releases/download/v0.84.0/syft_0.84.0_linux_amd64.tar.gz
[creator] Verifying checksum
[creator] Writing env.build/SYFT_CHECK_FOR_APP_UPDATE.default
[creator]
[creator] Paketo Buildpack for Executable JAR 6.7.4
[creator] https://github.com/paketo-buildpacks/executable-jar
[creator] Class Path: Contributing to layer
[creator] Writing env/CLASSPATH.delim
[creator] Writing env/CLASSPATH.prepend
[creator] Process types:
[creator] executable-jar: java org.springframework.boot.loader.JarLauncher (direct)
[creator] task: java org.springframework.boot.loader.JarLauncher (direct)
[creator] web: java org.springframework.boot.loader.JarLauncher (direct)
[creator]
[creator] Paketo Buildpack for Spring Boot 5.26.1
[creator] https://github.com/paketo-buildpacks/spring-boot
[creator] Build Configuration:
[creator] $BP_SPRING_CLOUD_BINDINGS_DISABLED false whether to contribute Spring Boot cloud bindings support
[creator] Launch Configuration:
[creator] $BPL_SPRING_CLOUD_BINDINGS_DISABLED false whether to auto-configure Spring Boot environment properties from bindings
[creator] $BPL_SPRING_CLOUD_BINDINGS_ENABLED true Deprecated - whether to auto-configure Spring Boot environment properties from bindings
[creator] Class Path: Contributing to layer
[creator] Writing env.build/CLASSPATH.append
[creator] Writing env.build/CLASSPATH.delim
[creator] Image labels:
[creator] org.opencontainers.image.title
[creator] org.opencontainers.image.version
[creator] org.springframework.boot.version
[creator] Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>.
[creator]
[creator] Paketo Buildpack for Native Image 5.12.1
[creator] https://github.com/paketo-buildpacks/native-image
[creator] Build Configuration:
[creator] $BP_BINARY_COMPRESSION_METHOD Compression mechanism used to reduce binary size. Options: `none` (default), `upx` or `gzexe`
[creator] $BP_NATIVE_IMAGE true enable native image build
[creator] $BP_NATIVE_IMAGE_BUILD_ARGUMENTS arguments to pass to the native-image command
[creator] $BP_NATIVE_IMAGE_BUILD_ARGUMENTS_FILE a file with arguments to pass to the native-image command
[creator] $BP_NATIVE_IMAGE_BUILT_ARTIFACT the built application artifact explicitly, required if building from a JAR
[creator] unable to invoke layer creator
[creator] error running version
[creator] exit status 20
[creator] ERROR: failed to build: exit status 1
> Task :bootBuildImage FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.2.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
9 actionable tasks: 1 executed, 8 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootBuildImage'.
> Builder lifecycle 'creator' failed with status code 51
* 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.
BUILD FAILED in 18s
At first I thought it was a jdk problem, I switched several versions of graalvm that didn't work
Use the spring initializer of IntelliJ IDEA 2023.1.4 to initialize a spring boot project, version 3.1.2
Build the image directly using gradle bootBuildImage
I want to create an application that can be launched using docker, with a small memory footprint and a fast startup speed
jdk version ๏ผ
Here is my directory structure (created using spring initializer)
|- gradle
|-- wrapper
|--- gradle-wrapper.jar
|--- gradle-wrapper.properties
|-- src
|-- main
|----java
|------......
|--------PinApi2Application.java
|
|-- test
|- .gitignore
|- build.gradle.kts
|- gradlew
|- gradlew.bat
|- HELP.md
|- settings.gradle.kts
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
PinApi2Application.java
package com.example.pinapi2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class PinApi2Application {
public static void main(String[] args) {
SpringApplication.run(PinApi2Application.class, args);
}
}
build.gradle.kts
plugins {
java
id("org.springframework.boot") version "3.1.2"
id("io.spring.dependency-management") version "1.1.2"
id("org.graalvm.buildtools.native") version "0.9.23"
}
group = "com.example"
version = "0.0.1-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_17
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
annotationProcessor("org.projectlombok:lombok")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
tasks.withType<Test> {
useJUnitPlatform()
}
settings.gradle.kts
rootProject.name = "pin-api2"
When running a build with a Spring Boot app and building a native-image, you'll see this warning:
Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>.
This happens because there is a bug in the build.go script. The problem is that we write an old-style SBOM entry here, but when you do a native-image build, we don't end up writing any new-style SBOM entries.
If you do a regular, non-native-image build you'll get new-style SBOM entries for the Spring Cloud Bindings JAR, but that doesn't get installed with Native image.
When you have old-style SBOM entries and no new-style SBOM entries, you get this particular warning.
I'm not totally sure. We don't need to write any SBOM entries in the new format because the application SBOM entries are generated in different buildpacks (executable-jar). Perhaps we could write an empty file and get past this warning?
This is very minor. It can just be a little confusing to see the WARNING. If we could suppress it, that would be helpful.
The GH action defined here: https://github.com/paketo-buildpacks/spring-boot/blob/main/.github/workflows/update-spring-generations.yml should work and generate an updated https://github.com/paketo-buildpacks/spring-boot/blob/main/spring-generations.toml
it fails
The spring website team has changed the Spring Boot generations URL from https://spring.io/api to https://api.spring.io/projects/spring-boot/generations
The GH action code could need to be updated since it appends /projects
to the uri that is given to it
It could be that a URL rewrite rule could be implemented, but it would just be a workaround I guess
You can look at a recent failure: https://github.com/paketo-buildpacks/spring-boot/actions/runs/4120288901
The scheduled action is down
via @philwebb
We found quite a few problems with the layered jar format so we changed direction quite late in the day. We now have a meta-data file instead of a an updated structure.
The fix #6 will probably need to be updated. The new format has now been documented here: https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#executable-jar-war-index-files
This Go code might also be useful. I used it to test that the layer.idx
file can be loaded as YAML.
The GraalVM native-image tooling looks in /META-INF/native-image
for JSON configuration, but the buildpack doesn't include that on the classpath (it only takes entries from BOOT-INF/lib
per the manifest). The result is that you either can't build an image, or it fails at runtime because it can't find resources that were configure there.
I believe that today we can support an in-container, iterative development flow without any additional support from the buildpack. We should create a screencast that shows this, and polish of any sharp edges we find during that processes.
org.springframework.boot:spring-boot-devtools
<excludeDevtools>false</excludeDevtools>
spring.devtools.remote.secret
org.springframework.boot.devtools.RemoteSpringApplication
Reference: https://docs.spring.io/spring-boot/docs/2.2.7.RELEASE/reference/htmlsingle/#using-boot-devtools
I have been getting a 404 this morning when attempting to build my docker container using the Spring Boot Build Pack with the information below. I had a build running last night that successfully resolved the jar, so my guess something must have happened last night to the repo. Please let me know if more information is required to hunt this down, Thanks!
[creator] Paketo Spring Boot Buildpack 5.13.0
[creator] https://github.com/paketo-buildpacks/spring-boot
[creator] Build Configuration:
[creator] $BP_SPRING_CLOUD_BINDINGS_DISABLED false whether to contribute Spring Boot cloud bindings support
[creator] Launch Configuration:
[creator] $BPL_SPRING_CLOUD_BINDINGS_DISABLED false whether to auto-configure Spring Boot environment properties from bindings
[creator] $BPL_SPRING_CLOUD_BINDINGS_ENABLED true Deprecated - whether to auto-configure Spring Boot environment properties from bindings
[creator] Creating slices from layers index
[creator] dependencies (63.9 MB)
[creator] spring-boot-loader (281.8 KB)
[creator] snapshot-dependencies (0.0 B)
[creator] application (217.2 KB)
[creator] Launch Helper: Contributing to layer
[creator] Creating /layers/paketo-buildpacks_spring-boot/helper/exec.d/spring-cloud-bindings
[creator] Spring Cloud Bindings 1.10.0: Contributing to layer
[creator] Downloading from https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.10.0/spring-cloud-bindings-1.10.0.jar
[creator] unable to invoke layer creator
[creator] unable to contribute spring-cloud-bindings layer
[creator] unable to get dependency spring-cloud-bindings
[creator] unable to download https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.10.0/spring-cloud-bindings-1.10.0.jar
[creator] could not download https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.10.0/spring-cloud-bindings-1.10.0.jar: 404
[creator] ERROR: failed to build: exit status 1
Spring cloud binding should not return a 404
It appears that the buildpack cant find the bindings jar
./gradlew bootBuildImage
on a spring boot projectAs part of spring-cloud/spring-cloud-dataflow#4053, the name of the Data Flow configuration properties file is changing to be more inclusive. The buildpack should detect and prefer this new name, while falling back to the deprecated name if it does not exist. This is a temporary state before the deprecated name is removed completely from both Data Flow and the buildpack.
With #272 we are looking for a key file, filepath.Join(n.ApplicationPath, "META-INF", "native-image", "argfile")
. If that file exists, we could assume that the user wants to have a native-image build and automatically enable native-image builds.
I'm not sure off hand if we can tie into the BP_NATIVE_IMAGE
env variable or if we'd need to modify the buildplan. The native-image buildpack says that if you set native-image-application
in the buildplan, it'll trigger a native-image build. One of these two options should work.
Right now a user has to manually set BP_NATIVE_IMAGE=true
to trigger a native-image build. The presence of this file could be a trigger which we can use to infer user intent and automatically enable a native-image build (or at least flip the default from false to true, a user should still be able to opt-out by forcing BP_NATIVE_IMAGE=false
).
Maven/Gradle buildpacks can produce a single JAR, in which case that JAR is exploded into the /workspace
directory. Spring Boot CNB expects this case.
The Maven/Gradle buildpacks can also produce multiple output files. The executable-jar CNB has support for this. It will filter and find the first JAR that is executable & use java -jar
as the command to run the app. This isn't presently going to work with the Spring Boot buildpack, because we expect there to be an exploded JAR for some of the features (like slices).
Support for multiple build artifacts is a relatively new feature. 1.) Explore how that fully impacts Spring Boot CNB and 2.) Make whatever accommodations are necessary to make things work as expected (or possibly emit a warning that features are not supported in this mode).
my project config:
springboot 3.1.1
jdk17
I made the image mvn spring-boot:build-image -Pnative
with the following command, and then it ran fine locally and failed to boot on a machine in a corporate environment and threw the following exception:
The current machine does not support all of the following CPU features that are required by the image: [CX8, CMOV, FXSR, MMX, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, POPCNT, LZCNT, AVX, AVX2, BMI1, BMI2, FMA].
Please rebuild the executable with an appropriate setting of the -march option.
How to set the -march option?
Per https://spring.io/blog/2022/12/14/notice-of-permissions-changes-to-repo-spring-io-january-2023, Spring team is restricting anonymous access to their "release" path on repo.spring.io
(among others). In the default configuration, the Spring Boot buildpack attempts to fetch pring-cloud-bindings
at a URL like https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.10.0/spring-cloud-bindings-1.10.0.jar
. This no longer works with the new policy on repo.spring.io
.
Buildpack build with Spring Boot buildpack and default settings should succeed.
Buildpack build with Spring Boot buildpack and default settings fails. Error below:
[creator] Paketo Buildpack for Spring Boot 5.20.0
[creator] https://github.com/paketo-buildpacks/spring-boot
[creator] Build Configuration:
[creator] $BP_SPRING_CLOUD_BINDINGS_DISABLED false whether to contribute Spring Boot cloud bindings support
[creator] Launch Configuration:
[creator] $BPL_SPRING_CLOUD_BINDINGS_DISABLED false whether to auto-configure Spring Boot environment properties from bindings
[creator] $BPL_SPRING_CLOUD_BINDINGS_ENABLED true Deprecated - whether to auto-configure Spring Boot environment properties from bindings
[creator] Creating slices from layers index
[creator] dependencies (73.8 MB)
[creator] spring-boot-loader (282.2 KB)
[creator] snapshot-dependencies (0.0 B)
[creator] application (8.9 MB)
[creator] Launch Helper: Contributing to layer
[creator] Creating /layers/paketo-buildpacks_spring-boot/helper/exec.d/spring-cloud-bindings
[creator] Spring Cloud Bindings 1.10.0: Contributing to layer
[creator] Downloading from https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.10.0/spring-cloud-bindings-1.10.0.jar
[creator] unable to invoke layer creator
[creator] unable to contribute spring-cloud-bindings layer
[creator] unable to get dependency spring-cloud-bindings
[creator] unable to download https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.10.0/spring-cloud-bindings-1.10.0.jar
[creator] could not download https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.10.0/spring-cloud-bindings-1.10.0.jar: 401
[creator] ERROR: failed to build: exit status 1
Spring Boot buildpack should fetch the spring-cloud-bindings release artifact from Maven Central or some other anonymous-access public repository.
Temporary workaround: disable Spring Cloud Bindings support by setting "BP_SPRING_CLOUD_BINDINGS_DISABLED": "true"
gradle bootBuildImage
Need builds to work :). Thank you!
spring.io/api
is not available anymore, api.spring.io
should be used instead.
See here:
The current job is failing: https://github.com/paketo-buildpacks/spring-boot/actions/runs/4120288901/jobs/7114865598#logs
This is just a feature request, so not sure the default template applies.
I'd like to set up a Docker HEALTHCHECK for a Spring Boot app running Spring Boot Actuator. Using the default Liberica JRE, curl
isn't present, so something like the following fails:
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check"]
interval: 5s
timeout: 2s
start_period: 15s
retries: 20
I thought "I guess I'll write a buildpack with some lightweight HTTP client in Java that I can reference from test:
", as explained nicely in this blog post. And then thought "Wait, I'm already using a Spring Boot buildpack, is this a regular enough use case for it to be included with the Spring Boot buildpack itself?" ๐
$BPI_APPLICATION_PATH missing in package when Jenkins execute :bootBuildImage without cleanCache = true
Setting Active Processor Count to 6
$BPI_APPLICATION_PATH must be set
ERROR: failed to launch: exec.d: failed to execute exec.d file at path '/layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator': exit status 1
What were you attempting to do?
Jenkins CI execute gradle task :bootBuildImage , if without without cleanCache = true, $BPI_APPLICATION_PATH is missing in the built package.
Gradle task :bootBuildImage, cleanCache = true.
What did you expect to happen?
$BPI_APPLICATION_PATH should be there
What was the actual behavior? Please provide log output, if possible.
Setting Active Processor Count to 6
$BPI_APPLICATION_PATH must be set
ERROR: failed to launch: exec.d: failed to execute exec.d file at path '/layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator': exit status 1
pack
, kpack
, tekton
buildpacks plugin, etc.) are youRunning creator
[creator] ===> DETECTING
[creator] 5 of 18 buildpacks participating
[creator] paketo-buildpacks/ca-certificates 2.3.0
[creator] paketo-buildpacks/bellsoft-liberica 8.1.0
[creator] paketo-buildpacks/executable-jar 5.1.0
[creator] paketo-buildpacks/dist-zip 4.1.0
[creator] paketo-buildpacks/spring-boot 4.4.0
[creator] ===> ANALYZING
[creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:jre" from app image
[creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:jvmkill" from app image
[creator] Restoring metadata for "paketo-buildpacks/spring-boot:spring-cloud-bindings" from app image
[creator] Restoring metadata for "paketo-buildpacks/spring-boot:web-application-type" from app image
[creator] ===> RESTORING
[creator] ===> BUILDING
[creator]
[creator] Paketo CA Certificates Buildpack 2.3.0
[creator] https://github.com/paketo-buildpacks/ca-certificates
[creator] Launch Helper: Contributing to layer
[creator] Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[creator]
[creator] Paketo BellSoft Liberica Buildpack 8.1.0
[creator] https://github.com/paketo-buildpacks/bellsoft-liberica
[creator] Build Configuration:
[creator] $BP_JVM_VERSION 16.* the Java version
[creator] Launch Configuration:
[creator] $BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
[creator] $BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
[creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[creator] BellSoft Liberica JRE 16.0.1: Reusing cached layer
[creator] Launch Helper: Contributing to layer
[creator] Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/active-processor-count
[creator] Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/java-opts
[creator] Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/link-local-dns
[creator] Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator
[creator] Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/openssl-certificate-loader
[creator] Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/security-providers-configurer
[creator] Creating /layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/security-providers-classpath-9
[creator] JVMKill Agent 1.16.0: Reusing cached layer
[creator] Java Security Properties: Contributing to layer
[creator] Writing env.launch/JAVA_SECURITY_PROPERTIES.default
[creator] Writing env.launch/JAVA_TOOL_OPTIONS.append
[creator] Writing env.launch/JAVA_TOOL_OPTIONS.delim
[creator]
[creator] Paketo Executable JAR Buildpack 5.1.0
[creator] https://github.com/paketo-buildpacks/executable-jar
[creator] Class Path: Contributing to layer
[creator] Writing env/CLASSPATH.delim
[creator] Writing env/CLASSPATH.prepend
[creator] Process types:
[creator] executable-jar: java org.springframework.boot.loader.JarLauncher (direct)
[creator] task: java org.springframework.boot.loader.JarLauncher (direct)
[creator] web: java org.springframework.boot.loader.JarLauncher (direct)
[creator]
[creator] Paketo Spring Boot Buildpack 4.4.0
[creator] https://github.com/paketo-buildpacks/spring-boot
[creator] Creating slices from layers index
[creator] dependencies
[creator] spring-boot-loader
[creator] snapshot-dependencies
[creator] application
[creator] Launch Helper: Contributing to layer
[creator] Creating /layers/paketo-buildpacks_spring-boot/helper/exec.d/spring-cloud-bindings
[creator] Spring Cloud Bindings 1.7.1: Reusing cached layer
[creator] Web Application Type: Contributing to layer
[creator] Servlet web application detected
[creator] Writing env.launch/BPL_JVM_THREAD_COUNT.default
[creator] 4 application slices
[creator] Image labels:
[creator] org.springframework.boot.version
[creator] ===> EXPORTING
[creator] Adding layer 'paketo-buildpacks/ca-certificates:helper'
[creator] Adding layer 'paketo-buildpacks/bellsoft-liberica:helper'
[creator] Adding layer 'paketo-buildpacks/bellsoft-liberica:java-security-properties'
[creator] Reusing layer 'paketo-buildpacks/executable-jar:classpath'
[creator] Adding layer 'paketo-buildpacks/spring-boot:helper'
[creator] Reusing layer 'paketo-buildpacks/spring-boot:web-application-type'
[creator] Reusing 3/5 app layer(s)
[creator] Adding 2/5 app layer(s)
[creator] Reusing layer 'launcher'
[creator] Adding layer 'config'
[creator] Reusing layer 'process-types'
[creator] Adding label 'io.buildpacks.lifecycle.metadata'
[creator] Adding label 'io.buildpacks.build.metadata'
[creator] Adding label 'io.buildpacks.project.metadata'
[creator] Adding label 'org.springframework.boot.version'
[creator] Setting default process type 'web'
Setting Active Processor Count to 6
$BPI_APPLICATION_PATH must be set
ERROR: failed to launch: exec.d: failed to execute exec.d file at path '/layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator': exit status 1
The Spring Generations workflow does not get updated by pipeline-builder and is using some older action versions. It needs updated to be compatible with changes coming in Github Actions (like outputs and Node.js version deprecations).
Update to latest major branch of actions.
If a user has Spring Cloud Bindings in their app, the buildpack will try to add it also and it creates problems. The buildpack should inspect the app to see if Spring Cloud Bindings is present and if present do nothing. If it's not present, it should install it.
This makes it easier if a user wants to control the version of SCB or create their own fork of SCB.
The error is described at https://stackoverflow.com/questions/65118519/spring-boot-gradle-bootbuildimage-task-with-private-repo
I build a spring image in a protected environment. Maven is configured to get every dependency using a nexus mirror. But when I build the image, it tries to download spring-cloud-bindings-1.7.1.jar
using https://repo.spring.io.
My proxy blocks repo.spring.io.
[INFO] [creator] Paketo Spring Boot Buildpack 4.4.2
[INFO] [creator] https://github.com/paketo-buildpacks/spring-boot
[INFO] [creator] Creating slices from layers index
[INFO] [creator] dependencies
[INFO] [creator] spring-boot-loader
[INFO] [creator] snapshot-dependencies
[INFO] [creator] application
[INFO] [creator] Launch Helper: Contributing to layer
[INFO] [creator] Creating /layers/paketo-buildpacks_spring-boot/helper/exec.d/spring-cloud-bindings
[INFO] [creator] Spring Cloud Bindings 1.7.1: Contributing to layer
[INFO] [creator] Downloading from https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar
[INFO] [creator] unable to invoke layer creator
[INFO] [creator] unable to contribute spring-cloud-bindings layer
[INFO] [creator] unable to get dependency spring-cloud-bindings
[INFO] [creator] unable to download https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar
[INFO] [creator] unable to request https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar
[INFO] [creator] Get "https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar": URLBlocked
[INFO] [creator] ERROR: failed to build: exit status 1
What platform (pack
, kpack
, tekton
buildpacks plugin, etc.) are you
using? Please include a version.
I use the default version included in spring-boot-maven-plugin 2.5.3
What buildpacks are you using? Please include versions.
I use the default buildpacks included in spring-boot-maven-plugin 2.5.3
What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>
?
paketobuildpacks/builder:base
Can you provide a sample app or relevant configuration (buildpack.yml
,
nginx.conf
, etc.)?
<image>
<builder>docker-proxy.example.com/paketobuildpacks/builder:base</builder>
<runImage>docker-proxy.example.com/paketobuildpacks/run:base-cnb</runImage>
<name>docker-internal.example.com/${project.artifactId}:${project.version}</name>
<env>
<BP_JVM_VERSION>16</BP_JVM_VERSION>
<BPL_SPRING_CLOUD_BINDINGS_ENABLED>false</BPL_SPRING_CLOUD_BINDINGS_ENABLED>
<HTTP_PROXY>http://proxy.example.com:8080</HTTP_PROXY>
<HTTPS_PROXY>http://proxy.example.com:8080</HTTPS_PROXY>
<NO_PROXY>localhost,127.0.0.1,*.example.com</NO_PROXY>
</env>
</image>
I would like to have a maven mirror URL environment variable option. For example, BPL_SPRING_CLOUD_BINDINGS_MAVEN_PROXY
.
I am using Paketo Spring Boot Buildpack 5.3.0
Yesterday my build worked. Now it doesnt. It fails with:
sha256 for /tmp/c75ef3152817c28c7049d7e0052dfba3ed461a7151984e594b656c0be927888e/spring-cloud-bindings-1.8.0.jar 38657efbee82aaf69ea4998d5839b701173b8ccd01db0f97c3a16f86b2436bf7 does not match expected c75ef3152817c28c7049d7e0052dfba3ed461a7151984e594b656c0be927888e
As far as i can see, buildpack.toml is announcing the checksum c75ef3152817c28c7049d7e0052dfba3ed461a7151984e594b656c0be927888e
for spring-cloud-bindings-1.8.0.jar
However, that jar may have been changed today, just 2 hours ago.
The new checksum is:
krische@ds0093:~/Downloads$ sha256sum spring-cloud-bindings-1.8.0.jar
38657efbee82aaf69ea4998d5839b701173b8ccd01db0f97c3a16f86b2436bf7 spring-cloud-bindings-1.8.0 (1).jar
I wonder what happened there. Anyone knows who can re-create the original jar again?
When I try to build native image using command ./gradlew bootBuildImage
I get the next error:
Paketo Spring Boot Buildpack 4.4.2
[creator] https://github.com/paketo-buildpacks/spring-boot
[creator] unable to invoke layer creator
[creator] failed to compute classpath
[creator] manifest does not contain Spring-Boot-Classpath-Index
[creator] ERROR: failed to build: exit status 1
All logs:
./gradlew bootBuildImage
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :bootBuildImage
Building image 'docker.io/library/stomp:0.0.1-SNAPSHOT'
> Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' ..................................................
> Pulled builder image 'paketobuildpacks/builder@sha256:2e48ef36f9e17d72a9dc37f7c2800fcde82c3018bdef6836c4ade8a7e06ff69f'
> Pulling run image 'docker.io/paketobuildpacks/run:tiny-cnb' ..................................................
> Pulled run image 'paketobuildpacks/run@sha256:6cec91e026cbdf498efd3de44d26642241591561106714e578fec9a354f2627f'
> Pulling buildpack image 'gcr.io/paketo-buildpacks/java-native-image:5.5.0' ..................................................
> Pulled buildpack image 'gcr.io/paketo-buildpacks/java-native-image@sha256:0def9132cae1a8d9ed577c4dd3c92d650bb8d333fa93df1b6ff97f5af7ffd055'
> Executing lifecycle version v0.13.0
> Using build cache volume 'pack-cache-e18067e752a1.build'
> Running creator
[creator] ===> DETECTING
[creator] 5 of 12 buildpacks participating
[creator] paketo-buildpacks/ca-certificates 2.3.2
[creator] paketo-buildpacks/graalvm 6.3.0
[creator] paketo-buildpacks/executable-jar 5.1.2
[creator] paketo-buildpacks/spring-boot 4.4.2
[creator] paketo-buildpacks/native-image 4.2.0
[creator] ===> ANALYZING
[creator] Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
[creator] ===> RESTORING
[creator] ===> BUILDING
[creator]
[creator] Paketo CA Certificates Buildpack 2.3.2
[creator] https://github.com/paketo-buildpacks/ca-certificates
[creator] Launch Helper: Contributing to layer
[creator] Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[creator]
[creator] Paketo GraalVM Buildpack 6.3.0
[creator] https://github.com/paketo-buildpacks/graalvm
[creator] Build Configuration:
[creator] $BP_JVM_VERSION 11.* the Java version
[creator] Launch Configuration:
[creator] $BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
[creator] $BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
[creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[creator] GraalVM JDK 11.0.12: Contributing to layer
[creator] Downloading from https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.2.0/graalvm-ce-java11-linux-amd64-21.2.0.tar.gz
<============-> 94% EXECUTING [2m 10s]
> :bootBuildImage
<============-> 94% EXECUTING [2m 36s]
<============-> 94% EXECUTING [3m 7s]
[creator] Verifying checksum
[creator] Expanding to /layers/paketo-buildpacks_graalvm/jdk
[creator] Adding 128 container CA certificates to JVM truststore
[creator] GraalVM Native Image Substrate VM 11.0.12
[creator] Downloading from https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.2.0/native-image-installable-svm-java11-linux-amd64-21.2.0.jar
[creator] Verifying checksum
[creator] Installing substrate VM
[creator] Processing Component archive: /tmp/6fc4c6becbe0331aa0a038660fde7c4769c6d6e97d5a90a716a898188d3a6df9/native-image-installable-svm-java11-linux-amd64-21.2.0.jar
[creator] Installing new component: Native Image (org.graalvm.native-image, version 21.2.0)
[creator] Writing env.build/JAVA_HOME.override
[creator] Writing env.build/JDK_HOME.override
[creator]
[creator] Paketo Executable JAR Buildpack 5.1.2
[creator] https://github.com/paketo-buildpacks/executable-jar
[creator] Class Path: Contributing to layer
[creator] Writing env.build/CLASSPATH.delim
[creator] Writing env.build/CLASSPATH.prepend
[creator]
[creator] Paketo Spring Boot Buildpack 4.4.2
[creator] https://github.com/paketo-buildpacks/spring-boot
[creator] unable to invoke layer creator
[creator] failed to compute classpath
[creator] manifest does not contain Spring-Boot-Classpath-Index
[creator] ERROR: failed to build: exit status 1
> Task :bootBuildImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootBuildImage'.
> Builder lifecycle 'creator' failed with status code 145
* 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
BUILD FAILED in 3m 34s
Gradle build file
plugins {
id 'org.springframework.boot' version '2.5.6'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'war'
id 'org.springframework.experimental.aot' version '0.10.5'
id 'org.graalvm.buildtools.native' version '0.9.4'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
maven { url 'https://repo.spring.io/release' }
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-websocket'
implementation 'org.springframework.kafka:spring-kafka'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.kafka:spring-kafka-test'
testImplementation 'org.springframework.security:spring-security-test'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
}
test {
useJUnitPlatform()
}
bootBuildImage {
builder = "paketobuildpacks/builder:tiny"
environment = [
"BP_NATIVE_IMAGE" : "true"
]
buildpacks = ["gcr.io/paketo-buildpacks/java-native-image:5.5.0"]
}
nativeBuild {
classpath(processAotResources.outputs, compileAotJava.outputs)
}
nativeTest {
classpath(processAotTestResources.outputs, compileAotTestJava.outputs)
}
Java version: java --version
java 11.0.10 2021-01-19 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.10+8-LTS-162)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.10+8-LTS-162, mixed mode)
OS: MacOS 12.0.1
Occasionally, we run into an OutOfMemoryError (Metaspace) when running an image built with build-image
of the spring-boot-maven-plugin
(Version 2.6.7).
We don't run out of metaspace.
An OutOfMemoryError is thrown at runtime.
I stumbled upon paketo-buildpacks/libjvm#88 and configured BPL_JVM_CLASS_ADJUSTMENT
(120% as a first approximation). While this might fix the issue I use an undocuemtned feature and I wonder if this should be configured by the spring-boot buildpack in order to relieve the applications from running into this problem.
Unfortunately, I'm not able to share a reproducer, but I hope the explanation is sufficient.
After the project is run as docker, Chinese always show a question mark when the console outputs๏ผ
Here is my code๏ผ
project info is:
spring-boot 3.1.1, jdk17
I've tried a lot of settingsใThe build configuration is now as follows:
<properties>
<!-- zh_CN.UTF-8, UTF-8, en_US.UTF-8 -->
<locale.value>zh_CN.utf-8</locale.value>
<java.version>17</java.version>
...
</properties>
...
<image>
<env>
<BPE_DELIM_JAVA_TOOL_OPTIONS xml:space="preserve"> </BPE_DELIM_JAVA_TOOL_OPTIONS>
<BPE_APPEND_JAVA_TOOL_OPTIONS>-Dfile.encoding=UTF-8</BPE_APPEND_JAVA_TOOL_OPTIONS>
<BPE_APPEND_JAVA_TOOL_OPTIONS>-Dsun.jnu.encoding=UTF-8</BPE_APPEND_JAVA_TOOL_OPTIONS>
<!-- ๅฎนๅจ่ฏญ่จ -->
<!-- https://stackoverflow.com/questions/71699595/how-to-change-docker-image-built-with-spring-boot-maven-plugin-env-from-posix-to/71710785 -->
<BPE_LANG>${locale.value}</BPE_LANG>
<BPE_LC_ALL>${locale.value}</BPE_LC_ALL>
<BPE_LC_CTYPE>${locale.value}</BPE_LC_CTYPE><!--LANGUAGE=en_US:en-->
<BPE_LANGUAGE>zh_CN:zh</BPE_LANGUAGE><!--LANGUAGE=en_US:en-->
<!-- Build a native image -->
<!--<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>-->
<!-- ็ฆ็จ CPU ไผๅ -->
<!-- https://github.com/spring-projects/spring-boot/issues/36576 -->
<!--<BP_NATIVE_IMAGE_BUILD_ARGUMENTS>-march=compatibility</BP_NATIVE_IMAGE_BUILD_ARGUMENTS>-->
<BP_NATIVE_IMAGE_BUILD_ARGUMENTS>
<!-- -H:+IncludeAllLocales-->
-Duser.country=CN -Duser.language=zh -H:IncludeLocales=fr,en,it,en
-H:+AddAllCharsets
</BP_NATIVE_IMAGE_BUILD_ARGUMENTS>
</env>
</image>
...
build:
mvn spring-boot:build-image -Pnative
building:
[INFO] --- spring-boot-maven-plugin:3.1.1:build-image (default-cli) @ authorization-server ---
[INFO] Building image 'docker.io/library/authorization-server:1.0-SNAPSHOT'
[INFO]
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 100%
[INFO] > Pulled builder image 'paketobuildpacks/builder@sha256:1a59354925fcb7ba54744b8017630c97c2b035e1a9e19309330557b9c66bfc2c'
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:tiny-cnb' 100%
[INFO] > Pulled run image 'paketobuildpacks/run@sha256:adf913cf28031f2090aeaedac65edb36f2987d81a23a8dffab5ea18ca216c94c'
[INFO] > Executing lifecycle version v0.16.5
[INFO] > Using build cache volume 'cache-authorization-server.build'
[INFO]
[INFO] > Running creator
[INFO] [creator] ===> ANALYZING
[INFO] [creator] Restoring data for SBOM from previous image
[INFO] [creator] ===> DETECTING
[INFO] [creator] 7 of 15 buildpacks participating
[INFO] [creator] paketo-buildpacks/ca-certificates 3.6.3
[INFO] [creator] paketo-buildpacks/bellsoft-liberica 10.2.6
[INFO] [creator] paketo-buildpacks/syft 1.32.1
[INFO] [creator] paketo-buildpacks/executable-jar 6.7.4
[INFO] [creator] paketo-buildpacks/spring-boot 5.26.1
[INFO] [creator] paketo-buildpacks/native-image 5.12.1
[INFO] [creator] paketo-buildpacks/environment-variables 4.5.3
[INFO] [creator] ===> RESTORING
[INFO] [creator] Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
[INFO] [creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:native-image-svm" from cache
[INFO] [creator] Restoring metadata for "paketo-buildpacks/syft:syft" from cache
[INFO] [creator] Restoring metadata for "paketo-buildpacks/native-image:native-image" from cache
[INFO] [creator] Restoring metadata for "paketo-buildpacks/environment-variables:environment-variables" from app image
[INFO] [creator] Restoring data for "paketo-buildpacks/bellsoft-liberica:native-image-svm" from cache
[INFO] [creator] Restoring data for "paketo-buildpacks/syft:syft" from cache
[INFO] [creator] Restoring data for "paketo-buildpacks/native-image:native-image" from cache
[INFO] [creator] Restoring data for SBOM from cache
[INFO] [creator] ===> BUILDINGskip...
[INFO] [creator] Paketo Buildpack for Environment Variables 4.5.3
[INFO] [creator] https://github.com/paketo-buildpacks/environment-variables
[INFO] [creator] Launch Configuration:
[INFO] [creator] $BPE_ prepend value to $NAME, delimiting with OS path list separator
[INFO] [creator] $BPE_APPEND_ append value to $NAME
[INFO] [creator] $BPE_DEFAULT_ set default value for $NAME
[INFO] [creator] $BPE_DELIM_ set delimeter to use when appending or prepending to $NAME
[INFO] [creator] $BPE_OVERRIDE_ set $NAME to value
[INFO] [creator] $BPE_PREPEND_ prepend value to $NAME
[INFO] [creator] Environment Variables: Contributing to layer
[INFO] [creator] Writing env.launch/JAVA_TOOL_OPTIONS.append
[INFO] [creator] Writing env.launch/JAVA_TOOL_OPTIONS.delim
[INFO] [creator] Writing env.launch/LANG
[INFO] [creator] Writing env.launch/LANGUAGE
[INFO] [creator] Writing env.launch/LC_ALL
[INFO] [creator] Writing env.launch/LC_CTYPE
[INFO] [creator] ===> EXPORTING
run:
docker run -it -e LANG=en_US.utf8 -p 9876:9876 authorization-server:1.0-SNAPSHOT
Locale -> it_IT, Country name -> Cina
Locale -> fr_FR, Country name -> Chine
Locale -> en_US, Country name -> China
Locale -> zh_CN, Country name -> ??
I've been stuck with this issue for a week, what should I do?
./gradlew :clean :bootBuildImage
build.gradle.kts
and repeat from step 2 above until docker is frozen. I can reproduce the bug after 4 or 5 tries.Happens on both Spring Boot 3 and Spring Boot 2
console-log-spring-boot-3-success.txt
Spring Boot 1.x is now EOL and it's been almost two years since the initial warning was issued.
https://spring.io/blog/2018/07/30/spring-boot-1-x-eol-aug-1st-2019
As of now, SB 2.3 is the current GA version.
I suggest adding a feature to detect a SB 1.x app and throw a warning like "SB 1.x is now EOL, consider upgrading to SB 2.x" and then link to https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide
To make it current by default, the buildpack should maintain a deny list and error out if an old SB version has been detected. If compatibility with 1.x needs to be maintained, then allowing a user to set an environment variable to override the BP and use older versions, could be offered as long as the warnings above are also issued.
Trying to Build image through Paketo Buildpack for Spring Boot Application through pack cli
What were you attempting to do?
pack build --builder=paketobuildpacks/builder:base myorg-docker.jfrog.io/ar-invoices-test:latest --env BPL_SPRING_CLOUD_BINDINGS_ENABLED=false
What was the actual behavior? Please provide log output, if possible.
condensed
Paketo Spring Boot Buildpack 4.2.0
https://github.com/paketo-buildpacks/spring-boot
Launch Helper: Contributing to layer
Creating /layers/paketo-buildpacks_spring-boot/helper/exec.d/spring-cloud-bindings
Spring Cloud Bindings 1.7.1: Contributing to layer
Downloading from https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar
unable to invoke layer creator
unable to contribute spring-cloud-bindings layer
unable to get dependency spring-cloud-bindings
unable to download https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar
unable to request https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar
Get "https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar": x509: certificate signed by unknown authority
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 145
What platform (pack
, kpack
, tekton
buildpacks plugin, etc.) are you
using?
pack version 0.18.0
What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>
?
paketobuildpacks/builder:base
I'm trying to find an equivalent for --network host
option when building and image with paketo-buildpacks, since I believe this is the only option for me to stop getting this error:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.0:build-image (default-cli)
on project myproject: Execution default-cli of goal
org.springframework.boot:spring-boot-maven-plugin:2.5.0:build-image failed:
Builder lifecycle 'creator' failed with status code 145 -> [Help 1]
<docker>
<host>tcp://127.0.0.1:2567</host>
</docker>
and billion other options put inside host
doesn't seem to help, instead resulting with the following error
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.0:build-image (default-cli)
on project myproject: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.5.0:build-image
failed: Connection to the Docker daemon at 'whatever I provided in <host>' failed with error
"whatever I provided in <host> failed to respond";
ensure the Docker daemon is running and accessible -> [Help 1]
is there something I'm missing? thanks
I have this vanilla Spring Boot app with only spring-boot-starter-web
and I am building an image for it.
This is what I get on startup with no customisation at all:
Container memory limit unset. Configuring JVM for 1G container.
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=88499K -XX:ReservedCodeCacheSize=240M -Xss1M -Xmx448076K (Head Room: 0%, Loaded Class Count: 13211, Thread Count: 250, Total Memory: 1.0G)
Adding 127 container CA certificates to JVM truststore
Spring Cloud Bindings Boot Auto-Configuration Enabled
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.2.RELEASE)
I find Spring Cloud Bindings Boot Auto-Configuration Enabled
a bit odd. The unqualified Boot
part seems unnecessary to me as the concept of Auto-Configuration is a concept that goes beyond Spring Boot itself. If I understood what this does, "Spring Cloud Bindings Auto-Configuration Enabled" looks a better message to me.
That said, I find it a little bit confusing that an app that doesn't use Spring Cloud at all has such a message on startup. Thoughts?
Hi,
In last version of buildpack I can not add my custom JAVA_OPTS.
Steps:
./mvnw spring-boot:build-image
.run -e "JAVA_OPTS=-Xmx400m" library/awesome_app:0.0.1-SNAPSHOT
Then I see at logs my params.
Setting Active Processor Count to 4
Adding $JAVA_OPTS to $JAVA_TOOL_OPTIONS
WARNING: Container memory limit unset. Configuring JVM for 1G container.
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=95268K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 1G, Thread Count: 250, Loaded Class Count: 14406, Headroom: 0%)
Adding 127 container CA certificates to JVM truststore
Spring Cloud Bindings Enabled
Picked up JAVA_TOOL_OPTIONS: -Djava.security.properties=/layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties -agentpath:/layers/paketo-buildpacks_bellsoft-liberica/jvmkill/jvmkill-1.16.0-RELEASE.so=printHeapHistogram=1 -XX:ActiveProcessorCount=4 -Xmx400m -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=95268K -XX:ReservedCodeCacheSize=240M -Xss1M -Dorg.springframework.cloud.bindings.boot.enable=true
But any params was passed to jar
cnb@ae43ae18befc:/$ ps ax | grep jav
1 ? Ssl 0:11 java org.springframework.boot.loader.JarLauncher
126 pts/0 S+ 0:00 grep --color=auto jav
It seems spring updated their ssl certs yesterday
and now all builds fail with
[builder] Get "https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar": x509: certificate signed by unknown authority
Also, if I run docker run -it paketobuildpacks/builder:base bash
curl https://www.google.com
and
curl https://spring.io
work fine, whereas
curl https://repo.spring.io
gives
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Running a build from our CI system as every day:
pack config default-builder paketobuildpacks/builder:base
pack build our-app:latest
Build should pass.
Build fails with
[builder] Paketo Spring Boot Buildpack 4.4.2
[builder] https://github.com/paketo-buildpacks/spring-boot
[builder] Creating slices from layers index
[builder] dependencies
[builder] spring-boot-loader
[builder] snapshot-dependencies
[builder] application
[builder] Launch Helper: Contributing to layer
[builder] Creating /layers/paketo-buildpacks_spring-boot/helper/exec.d/spring-cloud-bindings
[builder] Spring Cloud Bindings 1.7.1: Contributing to layer
[builder] Downloading from https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar
[builder] unable to invoke layer creator
[builder] unable to contribute spring-cloud-bindings layer
[builder] unable to get dependency spring-cloud-bindings
[builder] unable to download https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar
[builder] unable to request https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar
[builder] Get "https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.1/spring-cloud-bindings-1.7.1.jar": x509: certificate signed by unknown authority
[builder] ERROR: failed to build: exit status 1
pack
, kpack
, tekton
buildpacks plugin, etc.) are youpack-cli from ppa:cncf-buildpacks/pack-cli
pack version -> 0.19.0
[detector] 7 of 18 buildpacks participating
[detector] paketo-buildpacks/ca-certificates 2.3.2
[detector] paketo-buildpacks/bellsoft-liberica 8.1.2
[detector] paketo-buildpacks/maven 5.3.2
[detector] paketo-buildpacks/executable-jar 5.1.2
[detector] paketo-buildpacks/apache-tomcat 5.6.0
[detector] paketo-buildpacks/dist-zip 4.1.2
[detector] paketo-buildpacks/spring-boot 4.4.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.