anchor.diff:  For Maven, refer to the {spring-boot-maven-plugin-docs}#repackage-layers[packaging layered jars section] for more details on adding a layer index to the jar.
   For Gradle, refer to the {spring-boot-gradle-plugin-docs}#packaging-layered-jars[packaging layered jars section] of the Gradle plugin documentation.
   
  -
  -
  -==== Writing the Dockerfile
  +=== Building Container Images
  +Spring Boot applications can be containerized <<boot-features-container-images-docker,using Dockerfiles>>, or by <<boot-features-container-images-buildpacks,using Cloud Native Buildpacks to create docker compatible container images that you can run anywhere>>.
  +
  +[[boot-features-container-images-docker]]
  +==== Dockerfiles
  +While it is possible to convert a Spring Boot fat jar into a docker image with just a few lines in the Dockerfile, we will use the <<boot-layering-docker-images,layering feature>> to create an optimized docker image.
   When you create a jar containing the layers index file, the `spring-boot-jarmode-layertools` jar will be added as a dependency to your jar.
   With this jar on the classpath, you can launch your application in a special mode which allows the bootstrap code to run something entirely different from your application, for example, something that extracts the layers.
   
  
positive.code: 
  
  [[boot-features-container-images-buildpacks]]
  === Buildpacks
  Dockerfiles are just one way to build docker images.
  Another way to build docker images is directly from your Maven or Gradle plugin, using buildpacks.
  If you’ve ever used an application platform such as Cloud Foundry or Heroku then you’ve probably used a buildpack.
  
negative.code: 
  
  [[boot-features-container-images]]
  == Container Images
  It is easily possible to package a Spring Boot fat jar as a docker image.
  However, there are various downsides to copying and running the fat jar as is in the docker image.
  There’s always a certain amount of overhead when running a fat jar without unpacking it, and in a containerized environment this can be noticeable.
  The other issue is that putting your application's code and all its dependencies in one layer in the Docker image is sub-optimal.
  Since you probably recompile your code more often than you upgrade the version of Spring Boot you use, it’s often better to separate things a bit more.
  If you put jar files in the layer before your application classes, Docker often only needs to change the very bottom layer and can pick others up from its cache.
  
  [[boot-layering-docker-images]]
  === Layering Docker Images
  To make it easier to create optimized Docker images, Spring Boot supports adding a layer index file to the jar.
  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:
  