From d459e2986146bf16adf9c43f9c0f45086833eba6 Mon Sep 17 00:00:00 2001 From: Ralf Pannemans Date: Mon, 8 Jan 2024 10:31:57 +0100 Subject: [PATCH 1/3] Platform API changes for image extension build contexts Co-authored-by: Pavel Busko Signed-off-by: Pavel Busko --- image_extension.md | 18 ++++++++++++++++++ platform.md | 7 ++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/image_extension.md b/image_extension.md index f4e939a..436bb6c 100644 --- a/image_extension.md +++ b/image_extension.md @@ -89,9 +89,27 @@ Correspondingly, each `/bin/generate` executable: - MAY log output from the build process to `stdout`. - MAY emit error, warning, or debug messages to `stderr`. - MAY write either or both of `build.Dockerfile` and `run.Dockerfile` to the `` directory. This file MUST adhere to the requirements listed below. +- MAY create the following folders in the `` directory with an arbitrary content: + + either: + + - `context` + + or the image-specific folders: + + - `context.run` + - `context.build` - MAY write key-value pairs to `/extend-config.toml` that are provided as build args to build.Dockerfile when extending the build image. - MUST NOT write SBOM (Software-Bill-of-Materials) files as described in the [Software-Bill-of-Materials](#software-bill-of-materials) section. +#### Context Folders + +- The `/context` folder MUST NOT be created together with any combination of the image-specific folders. +- If the folder `/context` is present it will be set as Kaniko build context during the `extend` phase of the build and run images. +- If the folder `/context.run` is present it will be set as Kaniko build context during the `extend` phase of the run image only. +- If the folder `/context.build` is present it will be set as Kaniko build context during the `extend` phase of the build image only. +- If none of these folders is not present, Kaniko build context defaults to the `` folder. + #### Dockerfile Requirements A `run.Dockerfile` diff --git a/platform.md b/platform.md index dd50486..afb5528 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 Kaniko 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 66d4441cf98a12b42cf87c2d2c2f3a74704913c6 Mon Sep 17 00:00:00 2001 From: Ralf Pannemans Date: Tue, 9 Jan 2024 12:27:28 +0100 Subject: [PATCH 2/3] Update image_extension.md Co-authored-by: Natalie Arellano Signed-off-by: Ralf Pannemans --- image_extension.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/image_extension.md b/image_extension.md index 436bb6c..bb1edae 100644 --- a/image_extension.md +++ b/image_extension.md @@ -105,10 +105,10 @@ Correspondingly, each `/bin/generate` executable: #### Context Folders - The `/context` folder MUST NOT be created together with any combination of the image-specific folders. -- If the folder `/context` is present it will be set as Kaniko build context during the `extend` phase of the build and run images. -- If the folder `/context.run` is present it will be set as Kaniko build context during the `extend` phase of the run image only. -- If the folder `/context.build` is present it will be set as Kaniko build context during the `extend` phase of the build image only. -- If none of these folders is not present, Kaniko build context defaults to the `` folder. +- If the folder `/context` is present it will be set as the build context during the `extend` phase of the build and run images. +- If the folder `/context.run` is present it will be set as the build context during the `extend` phase of the run image only. +- If the folder `/context.build` is present it will be set as the build context during the `extend` phase of the build image only. +- If none of these folders is not present, the build context defaults to the `` folder. #### Dockerfile Requirements From 792a9fb2cae03ef0ffe4788db3a8b3a5b37e90bf Mon Sep 17 00:00:00 2001 From: Ralf Pannemans Date: Tue, 9 Jan 2024 12:27:52 +0100 Subject: [PATCH 3/3] Update platform.md Co-authored-by: Natalie Arellano Signed-off-by: Ralf Pannemans --- platform.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.md b/platform.md index afb5528..52763e1 100644 --- a/platform.md +++ b/platform.md @@ -607,7 +607,7 @@ When extending the build image: - 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 Kaniko build context to the folder 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`