How to package Spring Boot Executable Jar to Docker image?
See original GitHub issueSpring Boot Gradle and Maven plugins produce single Executable Jar file as described in reference docs https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#getting-started-first-application-executable-jar https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#executable-jar
It would be nice if jib supports this, pack just a single file into the image and use -jar, /app/libs/app.jar
option instead of -cp, /app/resources/:/app/classes/:/app/libs/*, app.Main
.
How to package Spring Boot Executable Jar to Docker image? Maybe it can be possible to achieve the same effect through some jib settings?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Getting Started | Spring Boot with Docker
The build creates a spring user and a spring group to run the application. It is then copied (by the COPY command) the...
Read more >Dockerizing a Spring Boot Application - Baeldung
In this tutorial, we'll focus on how to dockerize a Spring Boot Application to run it in an isolated environment, a.k.a. container.
Read more >9 Tips for Containerizing Your Spring Boot Code - Docker
Containerizing a Spring Boot application is easy. You can do this by copying the .jar or .war file right into a JDK base...
Read more >Docker Basics and Easy Steps to Dockerize Spring Boot ...
Create a Spring Boot Application · Create Dockerfile · Build executable jar file · Build Docker image · Run Docker container using the...
Read more >How To Dockerize a Spring Boot Application - HowToDoInJava
2. Verify the Docker Installation · Create a Spring Boot Application · Create an Executable JAR file · Create a Dokerfile · Create...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s too easy. I should have guessed 😃
Also dependencies should be added to make tasks work
@AlekseyChudov You can configure command line options via the
jib.container.jvmFlags
parameter.To use the JAR itself, you can set some configuration options to have Jib copy the JAR into the container:
build.gradle
:Note(by @loosebazooka): We definitely do not recommend using Jib this way, but it will work.