-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into more-extensions
- Loading branch information
Showing
17 changed files
with
316 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
content/docs/reference/spec/migration/buildpack-api-0.9-0.10.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
+++ | ||
title="Buildpack API 0.9 -> 0.10" | ||
+++ | ||
|
||
<!--more--> | ||
|
||
This guide is most relevant to buildpack authors. | ||
|
||
See the [spec release](https://github.com/buildpacks/spec/releases/tag/buildpack%2Fv0.10) for Buildpack API 0.10 for the full list of changes and further details. | ||
|
||
### Stacks are deprecated | ||
|
||
In Buildpack 0.10, the concepts of stacks and mixins are removed | ||
in favor of existing constructs in the container image ecosystem such as operating system name, operating system distribution, and architecture. | ||
|
||
#### Before build | ||
|
||
`builder.toml` contains a new table for buildpacks to express the os/arch combinations that they are compatible with: | ||
|
||
```toml | ||
[[targets]] | ||
os = "<OS name>" | ||
arch = "<architecture>" | ||
variant = "<architecture variant>" | ||
[[targets.distros]] | ||
name = "<OS distribution name>" | ||
version = "<OS distribution version>" | ||
``` | ||
|
||
All fields are optional and any missing field is assumed to "match any". | ||
|
||
This information will be used by the lifecycle to skip running detect on any buildpack that is not compatible with the current os/arch. | ||
|
||
Note that the `[[stacks]]` table is still supported and buildpack authors are encouraged to continue to provide this information for the time being | ||
in order to maintain compatibility with older platforms. | ||
|
||
#### During build | ||
|
||
The lifecycle will provide the following environment variables during `detect` and `build` to describe the target os/arch: | ||
|
||
| Env Variable | Description | | ||
|-----------------------------|-------------------------------------------| | ||
| `CNB_TARGET_OS` | Target OS | | ||
| `CNB_TARGET_ARCH` | Target architecture | | ||
| `CNB_TARGET_ARCH_VARIANT` | Target architecture variant (optional) | | ||
| `CNB_TARGET_DISTRO_NAME` | Target OS distribution name (optional) | | ||
| `CNB_TARGET_DISTRO_VERISON` | Target OS distribution version (optional) | | ||
|
||
Buildpacks can use this information to modify their behavior depending on the target. | ||
|
||
### Run image extensions is supported (experimental) | ||
|
||
In Platform 0.12, extensions can be used to extend not only build-time base images, but runtime base images as well. | ||
|
||
For more information, see [authoring an image extension](/docs/extension-guide/create-extension). |
70 changes: 70 additions & 0 deletions
70
content/docs/reference/spec/migration/platform-api-0.10-0.11.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
+++ | ||
title="Platform API 0.10 -> 0.11" | ||
+++ | ||
|
||
<!--more--> | ||
|
||
This guide is most relevant to platform operators and builder authors. | ||
|
||
See the [spec release](https://github.com/buildpacks/spec/releases/tag/platform%2Fv0.11) for Platform API 0.11 for the full list of changes and further details. | ||
|
||
## Platform Operator | ||
|
||
### SBOM files for the `launcher` are included in the application image | ||
|
||
In Platform 0.11, the lifecycle ships with standardized SBOM files describing the `lifecycle` and `launcher` binaries | ||
(these are included in the tarball on the GitHub release page and within the image at `index.docker.io/buildpacksio/lifecycle:<version>`). | ||
|
||
After a build, SBOM files describing the `launcher` are included in the application image at `<layers>/sbom/launch/buildpacksio_lifecycle/launcher/sbom.<ext>`, | ||
where `<ext>` is each of: `cdx.json`, `spdx.json`, and `syft.json`. | ||
Additionally, SBOM files describing the `lifecycle` are copied to `<layers>/sbom/build/buildpacksio_lifecycle/sbom.<ext>`, | ||
where they may be saved off by the platform prior to the build container exiting. | ||
|
||
This mirrors what is already being done as of Platform 0.8 for buildpack-provided standardized SBOM files, | ||
which are exported to `<layers>/sbom/launch/<buildpack-id>/<layer>/sbom.<ext>` (for runtime dependencies) | ||
and copied to `<layers>/sbom/launch/<buildpack-id>/sbom.<ext>` (for build-time dependencies). | ||
|
||
To use this feature, no additional action is required from platforms that are already handling buildpack-provided SBOM files. | ||
The SBOMs for the image will simply be more complete. | ||
|
||
### The rebaser accepts a -previous-image flag to allow rebasing by digest reference | ||
|
||
Previously, when rebasing an image, the rebased image would always be saved to the same tag as the original image. | ||
This prevented rebasing by digest, among other use cases. | ||
|
||
In Platform 0.11, the original image may be specified separately from the destination image with the `previous-image` flag, as in the following: | ||
|
||
```bash | ||
/cnb/lifecycle/rebaser -previous-image some-original-image some-destination-image | ||
``` | ||
|
||
As before, additional tags for the destination image can also be provided: | ||
|
||
```bash | ||
/cnb/lifecycle/rebaser -previous-image some-original-image -tag some-additional-tag:latest some-destination-image | ||
``` | ||
|
||
To use this feature, platforms can provide the new `-previous-image` flag to the `rebaser`. | ||
|
||
## Builder Author | ||
|
||
### Platforms can specify build time environment variables | ||
|
||
Builders can include a `/cnb/build-config/env/` directory to define environment variables for buildpacks. | ||
|
||
As an example, file `/cnb/build-config/env/SOME_VAR` with contents `some-val` will become `SOME_VAR=some-val` in the buildpack environment. | ||
|
||
Files in the `/cnb/build-config/env/` directory can use suffixes to control the behavior when another entity defines the same variable - | ||
e.g., if `/cnb/build-config/env/SOME_VAR.override` has contents `some-builder-val` and `<platform>/env/SOME_VAR` has contents `some-user-val`, | ||
the buildpack environment will contain `SOME_VAR=some-builder-val`. | ||
This is similar to the [environment modification rules for buildpacks](https://github.com/buildpacks/spec/blob/main/buildpack.md#environment-variable-modification-rules), | ||
except that the default behavior when no file suffix is provided is `default`. | ||
|
||
The order of application for env directories is: | ||
* Buildpack: `<layers>/<buildpack-id>/<layer>/<env>/` | ||
* User: `<platform>/env/` - overrides buildpack values | ||
* Builder: `/cnb/build-config/env/` | ||
|
||
For additional information, see the [buildpack environment](https://github.com/buildpacks/spec/blob/main/platform.md#buildpack-environment) section in the Platform spec. | ||
|
||
To use this feature, builder authors should include a `/cnb/build-config/env/` directory with the desired configuration. |
Oops, something went wrong.