From b19fdbdaa8d8d8e4eff94765ce535977b2fbf4b9 Mon Sep 17 00:00:00 2001 From: Ralf Pannemans Date: Tue, 9 Jan 2024 12:52:11 +0100 Subject: [PATCH 1/2] Platform API changes for image extension build contexts Signed-off-by: Ralf Pannemans Co-authored-by: Philipp Stehle Co-authored-by: Ralf Pannemans Co-authored-by: Pavel Busko --- platform.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform.md b/platform.md index dd50486..52763e1 100644 --- a/platform.md +++ b/platform.md @@ -605,14 +605,15 @@ When extending the build image: | `1-10`, `13-19` | Generic lifecycle errors | | `100-109` | Extension-specific lifecycle errors | -- For each extension in `` in order, if a Dockerfile exists in `//`, the lifecycle: +- For each extension in `` in order, if a Dockerfile exists in `//.Dockerfile`, the lifecycle: - SHALL apply the Dockerfile to the environment according to the process outlined in the [Image Extension Specification](image-extension.md). + - SHALL set the build context to the folder according to the process outlined in the [Image Extension Specification](image-extension.md). - The extended image MUST be an extension of: - The `build-image` in `` when `` is `build`, or - The `run-image` in `` when `` is `run` -- When extending the build image, after all `build.Dockefile`s are applied, the lifecycle: +- When extending the build image, after all `build.Dockerfile`s are applied, the lifecycle: - SHALL proceed with the `build` phase using the provided `` and `` -- When extending the run image, after all `run.Dockefile`s are applied, the lifecycle: +- When extending the run image, after all `run.Dockerfile`s are applied, the lifecycle: - **If** any `run.Dockerfile` set the label `io.buildpacks.rebasable` to `false` or left the label unset: - SHALL set the label `io.buildpacks.rebasable` to `false` on the extended run image - **If** after the final `run.Dockerfile` the run image user is `root`, From 3bb19203e3838ad0cb5623dc8c967f8d7bd15f05 Mon Sep 17 00:00:00 2001 From: Ralf Pannemans Date: Tue, 9 Jan 2024 13:09:03 +0100 Subject: [PATCH 2/2] Add recoring of build-image.extend Signed-off-by: Ralf Pannemans Co-authored-by: Philipp Stehle --- platform.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform.md b/platform.md index 52763e1..8d8df1c 100644 --- a/platform.md +++ b/platform.md @@ -77,6 +77,7 @@ Examples of a platform might include: - [Launch Environment](#launch-environment) - [Caching](#caching) - [Build Reproducibility](#build-reproducibility) + - [Map an image reference to a path in the layout directory](#map-an-image-reference-to-a-path-in-the-layout-directory) - [Data Format](#data-format) - [Files](#files) - [`analyzed.toml` (TOML)](#analyzedtoml-toml) @@ -443,9 +444,6 @@ The lifecycle: When image extensions are present in the order (optional and **[experimental](#experimental-features)**), the lifecycle: - SHALL execute all image extensions in the order defined in `` according to the process outlined in the [Buildpack Interface Specification](buildpack.md). - SHALL filter the build plan with dependencies provided by image extensions. -- SHALL copy any generated run.Dockerfiles to `/run//Dockerfile`. -- SHALL copy any generated build.Dockerfiles to `/build//Dockerfile`. -- SHALL copy any generated `` files to `/build//`. - SHALL replace `run-image` in `` with the selected run image. To select the run image, the lifecycle SHALL inspect each `run.Dockerfile` output by image extensions, in the order defined in ``: - **If** all `run.Dockerfile`s declare `FROM ${base_image}`, the selected run image SHALL be the original run image in ``, with `extend = true` - **Else** the selected run image SHALL be the last image referenced in the `FROM` statement of the last `run.Dockerfile` not to declare `FROM ${base_image}` @@ -457,6 +455,11 @@ When image extensions are present in the order (optional and **[experimental](#e - **Else** - `run-image.extend` SHALL be `true` - SHALL warn if the selected run image is not found in `` +- SHALL record `build-image` in `` + - **If** there are no `build.Dockerfile`s: + - `build-image.extend` SHALL be `false` + - **Else** + - `build-image.extend` SHALL be `true` #### `restorer`