Skip to content

Commit 82f8f3b

Browse files
author
Natalie Arellano
committed
Add migration guide for Platform 0.11
Signed-off-by: Natalie Arellano <[email protected]>
1 parent 35d15de commit 82f8f3b

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
+++
2+
title="Platform API 0.10 -> 0.11"
3+
+++
4+
5+
<!--more-->
6+
7+
This guide is most relevant to platform operators.
8+
9+
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.
10+
11+
## Platform Operator
12+
13+
### SBOM files for the `launcher` are included in the application image
14+
15+
In Platform 0.11, the lifecycle ships with standardized SBOM files describing the `lifecycle` and `launcher` binaries
16+
(these are included in the tarball on the GitHub release page and within the image at `index.docker.io/buildpacksio/lifecycle:<version>`).
17+
SBOM files describing the `launcher` are included in the application image at `<layers>/sbom/launch/buildpacksio_lifecycle/launcher/sbom.<ext>`,
18+
where `<ext>` is each of: `cdx.json`, `spdx.json`, and `syft.json`.
19+
Additionally, SBOM files describing the `lifecycle` are copied to `<layers>/sbom/build/buildpacksio_lifecycle/sbom.<ext>`,
20+
where they may be saved off by the platform prior to the build container exiting.
21+
22+
This mirrors what is already being done as of Platform 0.8 for buildpack-provided standardized SBOM files,
23+
which are exported to `<layers>/sbom/launch/<buildpack-id>/<layer>/sbom.<ext>` (for runtime dependencies)
24+
and copied to `<layers>/sbom/launch/<buildpack-id>/sbom.<ext>` (for build-time dependencies).
25+
Platforms that are already handling these files should not need to take additional action -
26+
the resulting SBOMs will simply be more complete.
27+
28+
### Platforms can specify build time environment variables
29+
30+
Builders can include a `/cnb/build-config/env/` directory to define environment variables for buildpacks.
31+
32+
As an example, file `/cnb/build-config/env/SOME_VAR` with contents `some-val` will become `SOME_VAR=some-val` in the buildpack environment.
33+
34+
Files in the `/cnb/build-config/env/` directory can use suffixes to control the behavior when another entity defines the same variable -
35+
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`,
36+
the buildpack environment will contain `SOME_VAR=some-builder-val`.
37+
This is similar to the [environment modification rules for buildpacks](https://github.com/buildpacks/spec/blob/main/buildpack.md#environment-variable-modification-rules),
38+
except that the default behavior when no file suffix is provided is `default`.
39+
40+
The order of application for env directories is:
41+
* Buildpack: `<layers>/<buildpack-id>/<layer>/<env>/`
42+
* User: `<platform>/env/` - overrides buildpack values
43+
* Builder: `/cnb/build-config/env/`
44+
45+
For additional information, see the [buildpack environment](https://github.com/buildpacks/spec/blob/main/platform.md#buildpack-environment) section in the Platform spec.
46+
47+
To use this feature, during builder creation operators should include a `/cnb/build-config/env/` directory with the desired configuration.
48+
49+
### The rebaser accepts a -previous-image flag to allow rebasing by digest reference
50+
51+
Previously, when rebasing an image, the rebased image would always be saved to the same tag as the original image.
52+
This prevented rebasing by digest, among other use cases.
53+
54+
In Platform 0.11, the original image may be specified separately from the destination image with the `previous-image` flag, as in the following:
55+
56+
```bash
57+
/cnb/lifecycle/rebaser -previous-image some-original-image some-destination-image
58+
```
59+
60+
As before, additional tags for the destination image can also be provided:
61+
62+
```bash
63+
/cnb/lifecycle/rebaser -previous-image some-original-image -tag some-additional-tag:latest some-destination-image
64+
```
65+
66+
To use this feature, platforms can provide the new `-previous-image` flag to the `rebaser`.

0 commit comments

Comments
 (0)