Create the layers configuration, modify the pom and Dockerfile
This commit is contained in:
parent
ebf5019635
commit
cd89253474
@ -45,6 +45,7 @@
|
||||
<configuration>
|
||||
<layers>
|
||||
<enabled>true</enabled>
|
||||
<configuration>${project.basedir}/src/layers.xml</configuration>
|
||||
</layers>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
27
docker/docker-spring-boot/src/layers.xml
Normal file
27
docker/docker-spring-boot/src/layers.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<layers xmlns="http://www.springframework.org/schema/boot/layers"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/boot/layers
|
||||
https://www.springframework.org/schema/boot/layers/layers-2.3.xsd">
|
||||
<application>
|
||||
<into layer="spring-boot-loader">
|
||||
<include>org/springframework/boot/loader/**</include>
|
||||
</into>
|
||||
<into layer="application" />
|
||||
</application>
|
||||
<dependencies>
|
||||
<into layer="snapshot-dependencies">
|
||||
<include>*:*:*SNAPSHOT</include>
|
||||
</into>
|
||||
<into layer="internal-dependencies">
|
||||
<include>com.baeldung.docker:*:*</include>
|
||||
</into>
|
||||
<into layer="dependencies" />
|
||||
</dependencies>
|
||||
<layerOrder>
|
||||
<layer>dependencies</layer>
|
||||
<layer>spring-boot-loader</layer>
|
||||
<layer>internal-dependencies</layer>
|
||||
<layer>snapshot-dependencies</layer>
|
||||
<layer>application</layer>
|
||||
</layerOrder>
|
||||
</layers>
|
@ -10,6 +10,7 @@ RUN java -Djarmode=layertools -jar application.jar extract
|
||||
FROM adoptopenjdk:11-jre-hotspot
|
||||
COPY --from=builder dependencies/ ./
|
||||
COPY --from=builder snapshot-dependencies/ ./
|
||||
COPY --from=builder internal-dependencies/ ./
|
||||
COPY --from=builder spring-boot-loader/ ./
|
||||
COPY --from=builder application/ ./
|
||||
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
|
Loading…
x
Reference in New Issue
Block a user