|
| 1 | ++++ |
| 2 | +title="Buildpack API 0.9 -> 0.10" |
| 3 | ++++ |
| 4 | + |
| 5 | +<!--more--> |
| 6 | + |
| 7 | +This guide is most relevant to buildpack authors. |
| 8 | + |
| 9 | +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. |
| 10 | + |
| 11 | +### Stacks are deprecated |
| 12 | + |
| 13 | +In Buildpack 0.10, the concepts of stacks and mixins are removed |
| 14 | +in favor of existing constructs in the container image ecosystem such as operating system name, operating system distribution, and architecture. |
| 15 | + |
| 16 | +#### Before build |
| 17 | + |
| 18 | +`builder.toml` contains a new table for buildpacks to express the os/arch combinations that they are compatible with: |
| 19 | + |
| 20 | +```toml |
| 21 | +[[targets]] |
| 22 | +os = "<OS name>" |
| 23 | +arch = "<architecture>" |
| 24 | +variant = "<architecture variant>" |
| 25 | +[[targets.distros]] |
| 26 | +name = "<OS distribution name>" |
| 27 | +version = "<OS distribution version>" |
| 28 | +``` |
| 29 | + |
| 30 | +All fields are optional and any missing field is assumed to "match any". |
| 31 | + |
| 32 | +This information will be used by the lifecycle to skip running detect on any buildpack that is not compatible with the current os/arch. |
| 33 | + |
| 34 | +Note that the `[[stacks]]` table is still supported and buildpack authors are encouraged to continue to provide this information for the time being |
| 35 | +in order to maintain compatibility with older platforms. |
| 36 | + |
| 37 | +#### During build |
| 38 | + |
| 39 | +The lifecycle will provide the following environment variables during `detect` and `build` to describe the target os/arch: |
| 40 | + |
| 41 | +| Env Variable | Description | |
| 42 | +|-----------------------------|-------------------------------------------| |
| 43 | +| `CNB_TARGET_OS` | Target OS | |
| 44 | +| `CNB_TARGET_ARCH` | Target architecture | |
| 45 | +| `CNB_TARGET_ARCH_VARIANT` | Target architecture variant (optional) | |
| 46 | +| `CNB_TARGET_DISTRO_NAME` | Target OS distribution name (optional) | |
| 47 | +| `CNB_TARGET_DISTRO_VERISON` | Target OS distribution version (optional) | |
| 48 | + |
| 49 | +Buildpacks can use this information to modify their behavior depending on the target. |
| 50 | + |
| 51 | +### Run image extensions is supported (experimental) |
| 52 | + |
| 53 | +In Platform 0.12, extensions can be used to extend not only build-time base images, but runtime base images as well. |
| 54 | + |
| 55 | +For more information, see [authoring an image extension](/docs/extension-guide/create-extension). |
0 commit comments