DEV Community

loading...

Discussion on: Containerize A Spring Boot App with Docker

Collapse
stealthmusic profile image
Jan Wedel

They copy the built spring boot executable jar file from the target folder in your project into the docker image and rename it to app.jar.

Collapse
barddo profile image
Charles Fonseca

Does it merge all jars into one, which is app.jar?

Thread Thread
scottshipp profile image
scottshipp Author

After you build, look in the target/ folder, you will see a jar named the name of your service + '-' + version. For example, if your service is named helloworld, and on version 0.1.0-SNAPSHOT it will be named helloworld-0.1.0-SNAPSHOT.jar.

This is the jar that will be copied into the Docker container as app.jar

Thread Thread
barddo profile image
Charles Fonseca

Thank you for explain!

Thread Thread
stealthmusic profile image
Jan Wedel

And yes, all dependencies will be inside the one app.jar. This is usually done by the spring boot maven plug-in.