Add jib: Spring Boot 4.2.0 images with Jib 3.5.2 vs Buildpacks
Same app built both ways: layers, reproducible digest, extraDirectories, registry push without a daemon, wrong-JRE and missing-compile failures, Buildpacks memory calculator at 512 MB. Captured output in jib/output, regenerated by jib/scripts/run-all.sh. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6ZEVHGaYy15HAxRzy
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
ddc3ec9d90
commit
bb12eaca0a
@@ -0,0 +1,22 @@
|
||||
package com.ankurm.jibdemo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class HelloController {
|
||||
|
||||
/** Change GREETING and rebuild to watch exactly one Jib layer change (scripts/04-layer-cache.sh). */
|
||||
static final String GREETING = "hello from a Jib image";
|
||||
|
||||
@GetMapping("/hello")
|
||||
public Map<String, Object> hello() {
|
||||
return Map.of(
|
||||
"greeting", GREETING,
|
||||
"javaVersion", Runtime.version().toString(),
|
||||
"maxHeapMb", Runtime.getRuntime().maxMemory() / (1024 * 1024),
|
||||
"user", System.getProperty("user.name"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ankurm.jibdemo;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class JibDemoApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(JibDemoApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
jib-demo image: this file came from src/main/jib/etc/motd.txt via extraDirectories
|
||||
@@ -0,0 +1,2 @@
|
||||
spring.application.name=jib-demo
|
||||
management.endpoints.web.exposure.include=health
|
||||
Reference in New Issue
Block a user