From 7dd7868bc44cc616844f4f06d146880866d26cce Mon Sep 17 00:00:00 2001 From: natalieparellano Date: Wed, 31 Jul 2024 17:36:35 +0000 Subject: [PATCH] Merge pull request #752 from hyounes4560/expand-slice-layers-page expand slice layers page --- .../create-slice-layers/index.html | 29 ++++++++++++++++--- .../how-to/write-buildpacks/index.html | 2 +- .../how-to/write-buildpacks/index.xml | 2 +- index.html | 2 +- index.xml | 2 +- 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers/index.html b/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers/index.html index 507f28b0a..0697d4ad9 100644 --- a/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers/index.html +++ b/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers/index.html @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -897,8 +897,29 @@

Create slice layers

-

This page is a stub! The CNB project is applying to Google Season of Docs to receive support for improving our documentation. Please check back soon.

-

If you are familiar with this content and would like to make a contribution, please feel free to open a PR :)

+

After all buildpacks have executed, the contents of the application directory will be included in the final application image as a single layer, OR as slice layers. A slice layer contains a portion of the application directory as defined by a filepath glob.

+

Slices are useful to avoid re-uploading unchanged data to the image registry. For example, if the application directory is a monolithic repository containing code for both a web frontend and sever backend, buildpacks can slice the directory into separate layers. Thus developers iterating on one part of the code base don’t have to wait for the entire directory to re-upload at the end of the build.

+

Key Points

+ +

Implementation Steps

+

Slices are added to the launch.toml file in the <layers>/<layer> directory as follows:

+
[[slices]]
+paths = ["<app sub-path glob>"]
+

A buildpack may specify sub-paths within <app> as slices in launch.toml. The lifecycle will create separate layers during the export phase for each slice containing one or more files or directories. Any files in the <app> directory that are not included in buildpack-defined slices will be included in the image as a final slice layer.

diff --git a/docs/for-buildpack-authors/how-to/write-buildpacks/index.html b/docs/for-buildpack-authors/how-to/write-buildpacks/index.html index 588464db6..c5ec906e6 100644 --- a/docs/for-buildpack-authors/how-to/write-buildpacks/index.html +++ b/docs/for-buildpack-authors/how-to/write-buildpacks/index.html @@ -962,7 +962,7 @@

Create slice layers

-

+

After all buildpacks have executed, the contents of the application directory will be included in the final application image as a single layer, OR as slice layers. A slice layer contains a portion of the application directory as defined by a filepath glob.

diff --git a/docs/for-buildpack-authors/how-to/write-buildpacks/index.xml b/docs/for-buildpack-authors/how-to/write-buildpacks/index.xml index c69211ab8..af5ec7b0c 100644 --- a/docs/for-buildpack-authors/how-to/write-buildpacks/index.xml +++ b/docs/for-buildpack-authors/how-to/write-buildpacks/index.xml @@ -61,7 +61,7 @@ https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers/ Mon, 01 Jan 0001 00:00:00 +0000 https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers/ - + <p>After all buildpacks have executed, the contents of the application directory will be included in the final application image as a single layer, OR as <code>slice</code> layers. A <code>slice</code> layer contains a portion of the application directory as defined by a <code>filepath</code> glob.</p> Re-use dependency layers diff --git a/index.html b/index.html index 5a32ef2fa..d9aacf14d 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + diff --git a/index.xml b/index.xml index 20b2c737f..81b399772 100644 --- a/index.xml +++ b/index.xml @@ -677,7 +677,7 @@ https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers/ Mon, 01 Jan 0001 00:00:00 +0000 https://buildpacks.io/docs/for-buildpack-authors/how-to/write-buildpacks/create-slice-layers/ - + <p>After all buildpacks have executed, the contents of the application directory will be included in the final application image as a single layer, OR as <code>slice</code> layers. A <code>slice</code> layer contains a portion of the application directory as defined by a <code>filepath</code> glob.</p> Re-use dependency layers