https://github.com/itzg/try-spring-boot-with-jib
https://github.com/itzg/try-spring-boot-with-jib
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/itzg/try-spring-boot-with-jib
- Owner: itzg
- Created: 2022-02-04T21:23:37.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-04T21:29:50.000Z (over 4 years ago)
- Last Synced: 2026-01-20T13:44:31.781Z (6 months ago)
- Language: Java
- Size: 58.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
I couldn't easily find a full example of using the Jib Spring Boot Gradle extension, so this is one.
## Usage
Build an image that is published into your Docker daemon:
```shell
./gradlew jibDockerBuild
```
Run that image:
```shell
docker run -it --rm -p 8080:8080 try-spring-boot-with-jib:0.0.1-SNAPSHOT
```
Check that it is running at
## Background
Without that extension applied, the Spring Boot devtools gets included in the built image. As a result, the devtools classloader will bootstrap as reported by the very first log:
```
ClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@5e076e79
```
and will try to expose the reload service, etc.
## Failure scenarios
### Missing jib-spring-boot-extension-gradle dependency
```
* What went wrong:
Execution failed for task ':jibDockerBuild'.
> error running extension 'com.google.cloud.tools.jib.plugins.extension.NullExtension': extension configured but not discovered on Jib runtime classpath: com.google.cloud.tools.jib.gradle.extension.springboot.JibSpringBootExtension
```
Add this at the **very top** of `build.gradle` before `plugins { ... }`
```
buildscript {
dependencies {
classpath('com.google.cloud.tools:jib-spring-boot-extension-gradle:0.1.0')
}
}
```