From 7a81cea513b6af8f36a2c580a46b6e7d59bbebe0 Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Mon, 29 Jun 2020 16:25:23 -0700 Subject: [PATCH] Update layers.idx file example in docs Fixes gh-21510 --- .../docs/asciidoc/spring-boot-features.adoc | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index 9e418e7201..e4d4b3b8f8 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -8185,8 +8185,8 @@ If you put jar files in the layer before your application classes, Docker often === Layering Docker Images To make it easier to create optimized Docker images that can be built with a dockerfile, Spring Boot supports adding a layer index file to the jar. -The `layers.idx` file lists all the files in the jar along with the layer that the file should go in. -The list of files in the index is ordered based on the order in which the layers should be added. +It provides a list of layers and the parts of the jar that should be contained within them. +The list of layers in the index is ordered based on the order in which the layers should be added to the Docker/OCI image. Out-of-the-box, the following layers are supported: * `dependencies` (for regular released dependencies) @@ -8198,14 +8198,17 @@ The following shows an example of a `layers.idx` file: [source] ---- -dependencies BOOT-INF/lib/library1.jar -dependencies BOOT-INF/lib/library2.jar -spring-boot-loader org/springframework/boot/loader/JarLauncher.class -spring-boot-loader org/springframework/boot/loader/jar/JarEntry.class -... -snapshot-dependencies BOOT-INF/lib/library3-SNAPSHOT.jar -application META-INF/MANIFEST.MF -application BOOT-INF/classes/a/b/C.class +- "dependencies": + - BOOT-INF/lib/library1.jar + - BOOT-INF/lib/library2.jar +- "spring-boot-loader": + - org/springframework/boot/loader/JarLauncher.class + - org/springframework/boot/loader/jar/JarEntry.class +- "snapshot-dependencies": + - BOOT-INF/lib/library3-SNAPSHOT.jar +- "application": + - META-INF/MANIFEST.MF + - BOOT-INF/classes/a/b/C.class ---- This layering is designed to separate code based on how likely it is to change between application builds.