Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform API changes for image extension build contexts #382

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions image_extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<output>` directory. This file MUST adhere to the requirements listed below.
- MAY create the following folders in the `<output>` directory with an arbitrary content:

either:

- `context`

or the image-specific folders:

- `context.run`
- `context.build`
- MAY write key-value pairs to `<output>/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 `<output>/context` folder MUST NOT be created together with any combination of the image-specific folders.
- If the folder `<output>/context` is present it will be set as Kaniko build context during the `extend` phase of the build and run images.
- If the folder `<output>/context.run` is present it will be set as Kaniko build context during the `extend` phase of the run image only.
- If the folder `<output>/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 `<app>` folder.
c0d1ngm0nk3y marked this conversation as resolved.
Show resolved Hide resolved

#### Dockerfile Requirements

A `run.Dockerfile`
Expand Down
7 changes: 4 additions & 3 deletions platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<group>` in order, if a Dockerfile exists in `<generated>/<kind>/<buildpack-id>`, the lifecycle:
- For each extension in `<group>` in order, if a Dockerfile exists in `<generated>/<buildpack-id>/<kind>.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).
c0d1ngm0nk3y marked this conversation as resolved.
Show resolved Hide resolved
- The extended image MUST be an extension of:
- The `build-image` in `<analyzed>` when `<kind>` is `build`, or
- The `run-image` in `<analyzed>` when `<kind>` 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 `<gid>` and `<uid>`
- 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`,
Expand Down