mirror of https://github.com/buildpacks/spec.git
Compare commits
192 Commits
buildpack/
...
main
Author | SHA1 | Date |
---|---|---|
|
d29ba81518 | |
|
bdcac26a7d | |
|
f3fd7555c8 | |
|
f8b60dc65c | |
|
08ee76ee4b | |
|
7f44395c97 | |
|
664e7a0eb3 | |
|
7207c7dd71 | |
|
c995c549f7 | |
|
b341177441 | |
|
7c68e77461 | |
|
87dc65b961 | |
|
551833d3d1 | |
|
bd040abaf6 | |
|
a5abebae3f | |
|
0389b50d7b | |
|
f56c8db7bb | |
|
15ddfc8027 | |
|
a762860c1e | |
|
b2fd486066 | |
|
845d862394 | |
|
cc0925b862 | |
|
2ff96c2b34 | |
|
296f8becfb | |
|
347a977e79 | |
|
29d53ac429 | |
|
d13cf5f53e | |
|
ae39fb0367 | |
|
88050e72d5 | |
|
e7f547c3c0 | |
|
f4778c7805 | |
|
334893105d | |
|
3bb19203e3 | |
|
b19fdbdaa8 | |
|
43c7cd9950 | |
|
36695bacab | |
|
cd8843b8b4 | |
|
0f5d7f2332 | |
|
7eb38d15fd | |
|
077230d06e | |
|
e1c08bf85e | |
|
a641ca1302 | |
|
50be8f2111 | |
|
0bfa2477d6 | |
|
2d58de770b | |
|
6acf1a3a83 | |
|
8e1cab2deb | |
|
93d7824177 | |
|
9e95588c38 | |
|
3324444812 | |
|
6738424280 | |
|
a65feb79c3 | |
|
73cd163308 | |
|
42c59ca68d | |
|
e6f047ed95 | |
|
ce7b1f8066 | |
|
e7ac2228c8 | |
|
9f8a0fbe0d | |
|
134bdde60b | |
|
4e63c2763b | |
|
a133f824e7 | |
|
85819652ea | |
|
bc1e7535a8 | |
|
f1ff20b6c6 | |
|
d3b6f14a97 | |
|
bae7ccd319 | |
|
4f4aa24be5 | |
|
ea0bcde72f | |
|
d6db12261e | |
|
a1512afa20 | |
|
92146ab4f9 | |
|
b4f953901c | |
|
5feb0b5206 | |
|
aec9203a46 | |
|
b0ccf7c48b | |
|
92669c592c | |
|
053e59acf4 | |
|
c0e281280b | |
|
4704d14a66 | |
|
cbf43c7257 | |
|
bf7d412cdb | |
|
26f60e3a20 | |
|
e16c633fd0 | |
|
7fd95e8a14 | |
|
db802b2645 | |
|
c6dd08c7ab | |
|
3deb450694 | |
|
5f0936c003 | |
|
910c3de050 | |
|
a05c4410f0 | |
|
2caf4d6413 | |
|
22ceb7f910 | |
|
5b7eadeb51 | |
|
9587e8cd4b | |
|
f2b87a29c1 | |
|
a2d78bb626 | |
|
058949f58c | |
|
00cecc280f | |
|
9741479b7f | |
|
2e06dd6c3b | |
|
a29f7fea62 | |
|
31dd9c3c94 | |
|
d11f06c5de | |
|
5f931eba5e | |
|
1fe9fd48af | |
|
46dc116a3b | |
|
8f6c0282cc | |
|
e41fd672c8 | |
|
32be97287f | |
|
8422bfedfd | |
|
fb093a37ff | |
|
d44ea666ac | |
|
c05b08eefc | |
|
417b853eba | |
|
02112bcff8 | |
|
83ce49fb34 | |
|
56a6557701 | |
|
24b950d6e8 | |
|
9a967d2c8a | |
|
f8c5409746 | |
|
c8d3936aa1 | |
|
e22d523b7b | |
|
77ab37b499 | |
|
d3069b8611 | |
|
7bec2312dc | |
|
b127b3da70 | |
|
8652ec5e49 | |
|
c985eeb170 | |
|
c0cf852657 | |
|
1d39e567a9 | |
|
8efb92a3ff | |
|
381ee53903 | |
|
c5d1691831 | |
|
1b0ea79c19 | |
|
9957239f0a | |
|
7822f9a3d1 | |
|
8a5929f3e5 | |
|
905754ee57 | |
|
538e1d0ca8 | |
|
4de1087877 | |
|
7c905e171b | |
|
4480ba7997 | |
|
5e9784721a | |
|
1947260dfc | |
|
9828bf3cb4 | |
|
4cacf53062 | |
|
80731d259d | |
|
a79c895d63 | |
|
f074ff25b1 | |
|
b5e07386d8 | |
|
4eb5f02e13 | |
|
9f5a417bf5 | |
|
4cff1db694 | |
|
f4424e9851 | |
|
67b286d027 | |
|
3e227b5bd4 | |
|
796133ad32 | |
|
ef56944eb5 | |
|
156a8124db | |
|
f1971a0e8e | |
|
2c5a8057c9 | |
|
64d392cc34 | |
|
b3c883b241 | |
|
f865cb0057 | |
|
ae5039b232 | |
|
eb6afa242a | |
|
4165ecbae8 | |
|
1231cb2100 | |
|
941516ee28 | |
|
ae549c2d47 | |
|
0373ea9f2a | |
|
84e00b6e36 | |
|
ec8769e0b3 | |
|
10293e9549 | |
|
d6141f2f8c | |
|
cac2d6e009 | |
|
c58ae52a92 | |
|
f31e623e17 | |
|
3140c7db6d | |
|
58904f2692 | |
|
4531d8cf44 | |
|
a2d3554db4 | |
|
53d6f3d685 | |
|
2bf99f1e67 | |
|
d38828abcd | |
|
55c89179db | |
|
e418312d79 | |
|
da08950773 | |
|
a7c0c9d485 | |
|
8023c3d44a | |
|
47785e0bdb | |
|
b31f86dd80 |
|
@ -50,6 +50,6 @@ When the specification refers to a path in the context of an OCI layer tar (e.g.
|
|||
|
||||
These documents currently specify:
|
||||
|
||||
- Buildpack API: `0.9`
|
||||
- Buildpack API: `0.10`
|
||||
- Distribution API: `0.3`
|
||||
- Platform API: `0.10`
|
||||
- Platform API: `0.14`
|
||||
|
|
203
buildpack.md
203
buildpack.md
|
@ -24,7 +24,6 @@ This document specifies the interface between a lifecycle program and one or mor
|
|||
- [Phase #1: Detection](#phase-1-detection)
|
||||
- [Purpose](#purpose)
|
||||
- [Process](#process)
|
||||
- [Mixin Satisfaction](#mixin-satisfaction)
|
||||
- [Order Resolution](#order-resolution)
|
||||
- [Phase #2: Analysis](#phase-2-analysis)
|
||||
- [Purpose](#purpose-1)
|
||||
|
@ -51,6 +50,7 @@ This document specifies the interface between a lifecycle program and one or mor
|
|||
- [Process](#process-5)
|
||||
- [Environment](#environment)
|
||||
- [Provided by the Lifecycle](#provided-by-the-lifecycle)
|
||||
- [Targets](#targets)
|
||||
- [Layer Paths](#layer-paths)
|
||||
- [Provided by the Platform](#provided-by-the-platform)
|
||||
- [Provided by the Buildpacks](#provided-by-the-buildpacks)
|
||||
|
@ -71,17 +71,18 @@ This document specifies the interface between a lifecycle program and one or mor
|
|||
- [Buildpack Plan (TOML)](#buildpack-plan-toml)
|
||||
- [Layer Content Metadata (TOML)](#layer-content-metadata-toml)
|
||||
- [buildpack.toml (TOML)](#buildpacktoml-toml)
|
||||
- [Stacks](#stacks)
|
||||
- [Targets](#targets-1)
|
||||
- [Order](#order)
|
||||
- [Exec.d Output (TOML)](#execd-output-toml)
|
||||
- [Deprecations](#deprecations)
|
||||
- [buildpack.toml (TOML) `stacks` Array](#buildpacktoml-toml-stacks-array)
|
||||
- [Positional Arguments to `detect` and `build` Executables](#positional-arguments-to-detect-and-build-executables)
|
||||
- [launch.toml (TOML) `bom` Array](#launchtoml-toml-bom-array)
|
||||
- [build.toml (TOML) `bom` Array](#buildtoml-toml-bom-array)
|
||||
- [Build Plan (TOML) `requires.version` Key](#build-plan-toml-requiresversion-key)
|
||||
|
||||
## Buildpack API Version
|
||||
This document specifies Buildpack API version `0.9`
|
||||
This document specifies Buildpack API version `0.10`
|
||||
|
||||
Buildpack API versions:
|
||||
- MUST be in form `<major>.<minor>` or `<major>`, where `<major>` is equivalent to `<major>.0`
|
||||
|
@ -102,7 +103,7 @@ A **component buildpack** is a buildpack containing `/bin/detect` and `/bin/buil
|
|||
|
||||
A **composite buildpack** is a buildpack containing an order definition in `buildpack.toml`. Composite buildpacks do not contain `/bin/detect` or `/bin/build` executables. They MUST be [resolvable](#order-resolution) into a collection of component buildpacks.
|
||||
|
||||
An **image extension** (**experimental**) is a directory containing an `extension.toml`. Extensions generate Dockerfiles that can be used to define the runtime base image, prior to buildpack execution. Extensions implement the [Image Extension Interface](image-extension.md). Extensions are always "component": their `extension.toml` cannot contain an order definition.
|
||||
An **image extension** is a directory containing an `extension.toml`. Extensions generate Dockerfiles that can be used to define the runtime base image, prior to buildpack execution. Extensions implement the [Image Extension Interface](image_extension.md). Extensions are always "component": their `extension.toml` cannot contain an order definition.
|
||||
|
||||
**Resolving an order** is the process by which an order (which may contain image extensions, component buildpacks, or composite buildpacks) is evaluated together with application source code to produce an optional group of image extensions and a required group of component buildpacks that can be used to build the application. This process is known as **detection**. During detection, the `/bin/detect` executable for each image extension (if present) and the `/bin/detect` executable for each component buildpack is invoked.
|
||||
|
||||
|
@ -132,10 +133,6 @@ A **layer directory** is a directory created by a component buildpack that conta
|
|||
* a **build layer** contains child directories with paths that are added to the environment (e.g., `PATH`, `LD_LIBRARY_PATH`, etc.) for subsequent buildpacks in the same build
|
||||
Any combination of the three layer types are valid for a particular layer directory.
|
||||
|
||||
A **stack** is a contract, implemented by a **build image** and **run image**, that guarantees properties of the **build environment** and **app image**. The provided stack is communicated to component buildpacks through the `CNB_STACK_ID` environment variable, enabling each component buildpack to modify its behavior when executed on different stacks.
|
||||
|
||||
A **mixin** is a named set of additions to a stack that can be used to make additive changes to the contract. Buildpacks can express their required mixins in `buildpack.toml`.
|
||||
|
||||
## Buildpack Interface
|
||||
|
||||
The following specifies the interface implemented by component buildpacks.
|
||||
|
@ -164,14 +161,14 @@ The lifecycle MAY return an error to the platform if two or more buildpacks with
|
|||
|
||||
Executable: `/bin/detect`, Working Dir: `<app[AR]>`
|
||||
|
||||
| Input | Attributes | Description |
|
||||
|--------------------------|------------|-----------------------------------------------|
|
||||
| `$0` | | Absolute path of `/bin/detect` executable |
|
||||
| `$CNB_BUILD_PLAN_PATH` | E | Absolute path of the build plan |
|
||||
| `$CNB_BUILDPACK_DIR` | ER | Absolute path of the buildpack root directory |
|
||||
| `$CNB_PLATFORM_DIR` | AR | Absolute path of the platform directory |
|
||||
| `$CNB_PLATFORM_DIR/env/` | AR | User-provided environment variables for build |
|
||||
| `$CNB_PLATFORM_DIR/#` | AR | Platform-specific extensions |
|
||||
| Input | Attributes | Description |
|
||||
|--------------------------|------------|---------------------------------------------------|
|
||||
| `$0` | | Absolute path of `/bin/detect` executable |
|
||||
| `$CNB_BUILD_PLAN_PATH` | E | Absolute path of the build plan |
|
||||
| `$CNB_BUILDPACK_DIR` | ER | Absolute path of the buildpack root directory |
|
||||
| `$CNB_PLATFORM_DIR` | AR | Absolute path of the platform directory |
|
||||
| `$CNB_PLATFORM_DIR/env/` | AR | User-provided environment variables for build |
|
||||
| `$CNB_PLATFORM_DIR/#` | AR | Platform-specific extensions |
|
||||
|
||||
| Output | Description |
|
||||
|------------------------|---------------------------------------------|
|
||||
|
@ -372,10 +369,13 @@ For each image extension ("extension") or component buildpack ("buildpack") in e
|
|||
The selected group MUST be filtered to only include extensions and buildpacks with exit status zero.
|
||||
The order of the extensions and buildpacks in the group MUST otherwise be preserved.
|
||||
|
||||
For each `/bin/detect` executable in each extension or buildpack, the lifecycle:
|
||||
|
||||
- MUST configure the environment as described in the [Environment](#environment) section.
|
||||
|
||||
The `/bin/detect` executable in each extension or buildpack, when executed:
|
||||
|
||||
- MAY read the app directory.
|
||||
- MAY read the detect environment as described in the [Environment](#environment) section.
|
||||
- MAY emit error, warning, or debug messages to `stderr`.
|
||||
- MAY augment the Build Plan by writing TOML to `<plan>`.
|
||||
- MUST set an exit status code as described in the [Buildpack Interface](#buildpack-interface) section.
|
||||
|
@ -400,21 +400,8 @@ For each trial,
|
|||
|
||||
The lifecycle MAY execute each `/bin/detect` within a group in parallel.
|
||||
|
||||
The lifecycle MUST run `/bin/detect` for all extensions and buildpacks in a group in a container using common stack with a common set of mixins.
|
||||
The lifecycle MUST fail detection if any of the buildpacks does not list that stack in `buildpack.toml`.
|
||||
The lifecycle MUST fail detection if any of the buildpacks specifies a mixin associated with that stack in `buildpack.toml` that is not satisfied, see [Mixin Satisfaction](#mixin-satisfaction) below.
|
||||
|
||||
#### Mixin Satisfaction
|
||||
|
||||
A buildpack's mixin requirements must be satisfied by the stack in one of the following scenarios.
|
||||
|
||||
1) the stack provides the mixin `run:<mixin>` and the buildpack requires `run:<mixin>`
|
||||
2) the stack provides the mixin `build:<mixin>` and the buildpack requires `build:<mixin>`
|
||||
3) the stack provides the mixin `<mixin>` and the buildpack requires `<mixin>`
|
||||
4) the stack provides the mixin `<mixin>` and the buildpack requires `build:<mixin>`
|
||||
5) the stack provides the mixin `<mixin>` and the buildpack requires `run:<mixin>`
|
||||
6) the stack provides the mixin `<mixin>` and the buildpack requires both `run:<mixin>` and `build:<mixin>`
|
||||
7) the stack provides the mixins `build:<mixin>` and `run:<mixin>` the buildpack requires `<mixin>`
|
||||
The lifecycle MUST run `/bin/detect` for all extensions and buildpacks in a group in a container using a common build environment.
|
||||
If any non-optional buildpack in a group fails to declare a target in `buildpack.toml` matching the build-time and runtime base images, and in the case that no targets are declared and the [inferred target](#targets-1) does not match, the lifecycle MUST fail detection for the group. For matching criteria, see [buildpack.toml](#buildpacktoml-toml).
|
||||
|
||||
#### Order Resolution
|
||||
|
||||
|
@ -513,7 +500,7 @@ The purpose of the generation phase is to generate Dockerfiles that can be used
|
|||
|
||||
### Process
|
||||
|
||||
See the [Image Extension Specification](#image-extension.md).
|
||||
See the [Image Extension Specification](#image_extension.md).
|
||||
|
||||
## Phase #4: Extension (image extensions only)
|
||||
|
||||
|
@ -687,7 +674,7 @@ The purpose of export is to create a new OCI image using a combination of remote
|
|||
- The `<layers>` directories provided to each buildpack during the build phase,
|
||||
- The `<app>` directory processed by the buildpacks during the build phase,
|
||||
- The buildpack IDs associated with the buildpacks used during the build phase, in order of execution,
|
||||
- A reference to the most recent version of the run image associated with the stack and mixins,
|
||||
- A reference to the most recent version of the run image,
|
||||
- A reference to the old OCI image processed during the analysis phase, if available, and
|
||||
- A tag for a new OCI image,
|
||||
|
||||
|
@ -760,9 +747,21 @@ The purpose of launch is to modify the running app environment using app-provide
|
|||
|
||||
### Provided by the Lifecycle
|
||||
|
||||
#### Targets
|
||||
|
||||
The following environment variables MUST be set by the lifecycle during the `detect` and `build` phases to describe the target runtime image, if inputs are provided.
|
||||
|
||||
| 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_VERSION` | Target OS distribution version (optional) |
|
||||
|
||||
#### Layer Paths
|
||||
|
||||
The following layer path environment variables MUST be set by the lifecycle during the build and launch phases in order to make buildpack dependencies accessible.
|
||||
The following layer path environment variables MUST be set by the lifecycle during the `build` and `launch` phases in order to make buildpack dependencies accessible.
|
||||
|
||||
During the build phase, each variable designated for build MUST contain absolute paths of all previous buildpacks’ `<layers>/<layer>/` directories that are designated for build.
|
||||
|
||||
|
@ -782,19 +781,18 @@ In either case,
|
|||
| `CPATH` | `/include` | header files | [x] | |
|
||||
| `PKG_CONFIG_PATH` | `/pkgconfig` | pc files | [x] | |
|
||||
|
||||
|
||||
### Provided by the Platform
|
||||
|
||||
The following additional environment variables MUST NOT be overridden by the lifecycle.
|
||||
|
||||
| Env Variable | Description | Detect | Build | Launch
|
||||
|-----------------|------------------------------------------------|--------|-------|--------
|
||||
| `CNB_STACK_ID` | Chosen stack ID | [x] | [x] |
|
||||
| `BP_*` | User-provided variable for buildpack | [x] | [x] |
|
||||
| `BPL_*` | User-provided variable for exec.d | | | [x]
|
||||
| `HOME` | Current user's home directory | [x] | [x] | [x]
|
||||
| Env Variable | Description | Detect | Build | Launch |
|
||||
|------------------------|---------------------------------------------------|--------|-------|--------|
|
||||
| `BP_*` | User-provided variable for buildpack | [x] | [x] | |
|
||||
| `BPL_*` | User-provided variable for exec.d | | | [x] |
|
||||
| `HOME` | Current user's home directory | [x] | [x] | [x] |
|
||||
|
||||
During the detection and build phases, the lifecycle MUST provide any user-provided environment variables as files in `<platform>/env/` with file names and contents matching the environment variable names and contents.
|
||||
During the detection and build phases, the lifecycle MUST provide as environment variables any user-provided files in `<platform>/env/` with environment variable names and contents matching the file names and contents.
|
||||
During the detection and build phases, the lifecycle MUST provide as environment variables any operator-provided files in `<build-config>/env` with environment variable names and contents matching the file names and contents. This applies for all values of `clear-env` or if `clear-env` is undefined in `buildpack.toml`.
|
||||
|
||||
When `clear-env` in `buildpack.toml` is set to `true` for a given buildpack, the lifecycle MUST NOT set user-provided environment variables in the environment of `/bin/detect` or `/bin/build`.
|
||||
|
||||
|
@ -802,8 +800,6 @@ When `clear-env` in `buildpack.toml` is not set to `true` for a given buildpack,
|
|||
1. For layer path environment variables, user-provided values are prepended before any existing values and are delimited by the OS path list separator.
|
||||
2. For all other environment variables, user-provided values override any existing values.
|
||||
|
||||
Buildpacks MAY use the value of `CNB_STACK_ID` to modify their behavior when executed on different stacks.
|
||||
|
||||
The environment variable prefix `CNB_` is reserved.
|
||||
It MUST NOT be used for environment variables that are not defined in this specification or approved extensions.
|
||||
|
||||
|
@ -1059,9 +1055,13 @@ id = "<buildpack ID>"
|
|||
version = "<buildpack version>"
|
||||
optional = false
|
||||
|
||||
[[stacks]]
|
||||
id = "<stack ID>"
|
||||
mixins = ["<mixin name>"]
|
||||
[[targets]]
|
||||
os = "<OS name>"
|
||||
arch = "<architecture>"
|
||||
variant = "<architecture variant>"
|
||||
[[targets.distros]]
|
||||
name = "<OS distribution name>"
|
||||
version = "<OS distribution version>"
|
||||
|
||||
[metadata]
|
||||
# buildpack-specific data
|
||||
|
@ -1081,8 +1081,6 @@ Buildpack authors MUST choose a globally unique ID, for example: "io.buildpacks.
|
|||
- Each element MUST increase numerically.
|
||||
- Buildpack authors will define what changes will increment `X`, `Y`, and `Z`.
|
||||
|
||||
If an `order` is specified, then `stacks` MUST NOT be specified.
|
||||
|
||||
**The buildpack API:**
|
||||
|
||||
*Key: `api = "<buildpack API version>"`*
|
||||
|
@ -1102,17 +1100,24 @@ The `[[buildpack.licenses]]` table is optional and MAY contain a list of buildpa
|
|||
*Key: `sbom-formats = [ "<string>" ]`*
|
||||
- MUST be supported SBOM media types as described in [Software-Bill-of-Materials](#software-bill-of-materials).
|
||||
|
||||
#### Stacks
|
||||
#### Targets
|
||||
|
||||
A buildpack descriptor may specify `stacks`.
|
||||
A buildpack descriptor SHOULD specify `targets`.
|
||||
|
||||
Each stack in `stacks` either:
|
||||
- MUST identify a compatible stack:
|
||||
- `id` MUST be set to a [valid stack ID](https://github.com/buildpacks/spec/blob/main/platform.md#stack-id).
|
||||
- `mixins` MAY contain one or more mixin names.
|
||||
- Or MUST indicate compatibility with any stack:
|
||||
- `id` MUST be set to the special value `"*"`.
|
||||
- `mixins` MUST be empty.
|
||||
Each target in `targets`:
|
||||
- MUST identify a compatible runtime environment:
|
||||
- `os`, `arch`, and `variant` if provided MUST be valid identifiers as defined in the [OCI Image Specification](https://github.com/opencontainers/image-spec/blob/main/config.md)
|
||||
- `distros` if provided MUST describe the OS distributions supported by the buildpack
|
||||
- For Linux-based images, `distros.name` and `distros.version` SHOULD contain the values specified in `/etc/os-release` (`$ID` and `$VERSION_ID`), as the `os.version` field in an image config may contain combined distribution and version information
|
||||
- For Windows-based images, `distros.name` SHOULD be empty; `distros.version` SHOULD contain the value of `os.version` in the image config (e.g., `10.0.14393.1066`)
|
||||
- Any field not provided will be interpreted as `<matches any>`
|
||||
|
||||
If the `targets` list is empty, tools reading `buildpack.toml` will assume:
|
||||
- `os = "linux"` and `arch = <matches any>` if `./bin/build` is present
|
||||
- `os = "windows"` and `arch = <matches any>` if `./bin/build.bat` or `./bin/build.exe` are present
|
||||
|
||||
Metadata specified in `[[targets]]` is validated against the runtime and build-time base images.
|
||||
* A buildpack target satisfies a base image target when `os`, `arch`, and `variant` match and at least one distribution in `distros` (if provided) matches
|
||||
|
||||
#### Order
|
||||
|
||||
|
@ -1135,6 +1140,41 @@ Each `key`:
|
|||
## Deprecations
|
||||
This section describes all the features that are deprecated.
|
||||
|
||||
### buildpack.toml (TOML) `stacks` Array
|
||||
|
||||
_Deprecated in Buildpack API 0.10._
|
||||
|
||||
The `stacks` array is deprecated.
|
||||
|
||||
```toml
|
||||
[[stacks]]
|
||||
id = "<stack ID>"
|
||||
mixins = ["<mixin name>"]
|
||||
```
|
||||
|
||||
Each stack in `stacks` either:
|
||||
- MUST identify a compatible stack:
|
||||
- `id` MUST be set to a [valid stack ID](https://github.com/buildpacks/spec/blob/main/platform.md#stack-id).
|
||||
- `mixins` MAY contain one or more mixin names.
|
||||
- Or MUST indicate compatibility with any stack:
|
||||
- `id` MUST be set to the special value `"*"`.
|
||||
- `mixins` MUST be empty.
|
||||
|
||||
If an `order` is specified, then `stacks` MUST NOT be specified.
|
||||
|
||||
Tools reading `buildpack.toml` will translate any section that sets `stacks.id = "io.buildpacks.stacks.bionic"` to:
|
||||
|
||||
```toml
|
||||
[[targets]]
|
||||
os = "linux"
|
||||
arch = "amd64"
|
||||
[[targets.distros]]
|
||||
name = "ubuntu"
|
||||
version = "18.04"
|
||||
```
|
||||
|
||||
Furthermore, any buildpack that contains `[[stacks]]` with `id = "*"` will match any target.
|
||||
|
||||
### Positional Arguments to `detect` and `build` Executables
|
||||
|
||||
_Deprecated in Buildpack API 0.8._
|
||||
|
@ -1202,48 +1242,3 @@ If the `bom` array is used, the buildpack:
|
|||
When the build is complete, a legacy build BOM describing the build container MAY be generated for auditing purposes.
|
||||
|
||||
If generated, this legacy build BOM MUST contain all `bom` entries in each `build.toml` at the end of each `/bin/build` execution, in adherence with the process and data format outlined in the [Platform Interface Specification](platform.md) for legacy BOM formats.
|
||||
|
||||
|
||||
### Build Plan (TOML) `requires.version` Key
|
||||
|
||||
_Deprecated in Buildpack API 0.3._
|
||||
|
||||
The `requires.version` and `or.requires.version` keys are deprecated.
|
||||
|
||||
```toml
|
||||
[[requires]]
|
||||
name = "<dependency name>"
|
||||
version = "<dependency version>"
|
||||
|
||||
[[or.requires]]
|
||||
name = "<dependency name>"
|
||||
version = "dependency version>"
|
||||
```
|
||||
|
||||
To upgrade, buildpack authors SHOULD set `requires.version` as `requires.metadata.version` and `or.requires.version` as `or.requires.metadata.version`.
|
||||
|
||||
```toml
|
||||
[[requires]]
|
||||
name = "<dependency name>"
|
||||
|
||||
[requires.metadata]
|
||||
version = "<dependency version>"
|
||||
|
||||
[[or.requires]]
|
||||
name = "<dependency name>"
|
||||
|
||||
[or.requires.metadata]
|
||||
version = "<dependency version>"
|
||||
```
|
||||
|
||||
If `requires.version` and `requires.metadata.version` or `or.requires.version` and `or.requires.metadata.version` are both defined then lifecycle will fail.
|
||||
|
||||
For backwards compatibility, the lifecycle will produce a Buildpack Plan (TOML) that puts `version` in `entries.metadata` as long as `version` does not exist in `requires.metadata`.
|
||||
|
||||
```toml
|
||||
[[entries]]
|
||||
name = "<dependency name>"
|
||||
|
||||
[entries.metadata]
|
||||
version = "<dependency version>"
|
||||
```
|
||||
|
|
|
@ -29,8 +29,8 @@ This document specifies Project Descriptor Schema Version `0.2`.
|
|||
|
||||
The Schema Version format follows the form of the [Buildpack API Version](https://github.com/buildpacks/spec/blob/main/buildpack.md#buildpack-api-version):
|
||||
|
||||
* MUST be in form <major>.<minor> or <major>, where <major> is equivalent to <major>.0
|
||||
* When <major> is greater than 0 increments to <minor> SHALL exclusively indicate additive changes
|
||||
* MUST be in form `<major>.<minor>` or `<major>`, where `<major>` is equivalent to `<major>.0`
|
||||
* When `<major>` is greater than 0, increments to `<minor>` SHALL exclusively indicate additive changes
|
||||
|
||||
## Special Value Types
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Image Extension Interface Specification (**experimental**)
|
||||
# Image Extension Interface Specification
|
||||
|
||||
This document specifies the interface between a lifecycle program and one or more image extensions.
|
||||
|
||||
|
@ -21,7 +21,7 @@ This document specifies the interface between a lifecycle program and one or mor
|
|||
|
||||
## Image Extension API Version
|
||||
|
||||
This document accompanies Buildpack API version `0.9`.
|
||||
This document accompanies Buildpack API version `0.10`.
|
||||
|
||||
## Image Extension Interface
|
||||
|
||||
|
@ -89,15 +89,40 @@ 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 the 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 the build context during the `extend` phase of the run image only.
|
||||
- If the folder `<output>/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 `<app>` folder.
|
||||
|
||||
#### Dockerfile Requirements
|
||||
|
||||
A `run.Dockerfile`
|
||||
|
||||
- MAY contain a single `FROM` instruction
|
||||
- MUST NOT contain any other instructions
|
||||
- MUST NOT contain any other `FROM` instructions
|
||||
- MAY contain `ADD`, `ARG`, `COPY`, `ENV`, `LABEL`, `RUN`, `SHELL`, `USER`, and `WORKDIR` instructions
|
||||
- SHOULD NOT contain any other instructions
|
||||
- SHOULD use the `build_id` build arg to invalidate the cache after a certain layer. When the `$build_id` build arg is referenced in a `RUN` instruction, all subsequent layers will be rebuilt on the next build (as the value will change); the `build_id` build arg SHOULD be defaulted to 0 if used (this ensures portability)
|
||||
- SHOULD NOT edit `<app>`, `<layers>`, or `<platform>` directories (see the [Platform Interface Specification](platform.md)) as changes will not be persisted
|
||||
- SHOULD use the `user_id` and `group_id` build args to reset the image config's `User` field to its original value if any `USER` instructions are employed
|
||||
- SHOULD set the label `io.buildpacks.rebasable` to `true` to indicate that any new run image layers are safe to rebase on top of new runtime base images
|
||||
- For the final image to be rebasable, all applied Dockerfiles must set this label to `true`
|
||||
|
||||
A `build.Dockerfile`
|
||||
|
||||
|
@ -110,7 +135,8 @@ FROM ${base_image}
|
|||
- MAY contain `ADD`, `ARG`, `COPY`, `ENV`, `LABEL`, `RUN`, `SHELL`, `USER`, and `WORKDIR` instructions
|
||||
- SHOULD NOT contain any other instructions
|
||||
- SHOULD use the `build_id` build arg to invalidate the cache after a certain layer. When the `$build_id` build arg is referenced in a `RUN` instruction, all subsequent layers will be rebuilt on the next build (as the value will change); the `build_id` build arg SHOULD be defaulted to 0 if used (this ensures portability)
|
||||
- SHOULD NOT edit `<app>`, `<layers>`, or `<workspace>` directories (see the [Platform Interface Specification](platform.md)) as changes will not be persisted
|
||||
- SHOULD NOT edit `<app>`, `<layers>`, or `<platform>` directories (see the [Platform Interface Specification](platform.md)) as changes will not be persisted
|
||||
- SHOULD use the `user_id` and `group_id` build args to reset the image config's `User` field to its original value if any `USER` instructions are employed
|
||||
|
||||
## Phase: Extension
|
||||
|
||||
|
@ -132,6 +158,9 @@ For each Dockerfile in the group in order, the lifecycle MUST apply the Dockerfi
|
|||
- When there are multiple Dockerfiles, the value MUST be the intermediate image generated from the application of the previous Dockerfile.
|
||||
- A `build_id` build arg
|
||||
- The value MUST be a UUID
|
||||
- `user_id` and `group_id` build args
|
||||
- For the first Dockerfile, the values MUST be the original `uid` and `gid` from the `User` field of the config for the original base image.
|
||||
- When there are multiple Dockerfiles, the values MUST be the `uid` and `gid` from the `User` field of the config for the intermediate image generated from the application of the previous Dockerfile.
|
||||
|
||||
## Data Format
|
||||
|
||||
|
@ -155,24 +184,45 @@ keywords = [ "<string>" ]
|
|||
[[extension.licenses]]
|
||||
type = "<string>"
|
||||
uri = "<uri>"
|
||||
|
||||
[[targets]]
|
||||
os = "<OS name>"
|
||||
arch = "<architecture>"
|
||||
variant = "<architecture variant>"
|
||||
[[targets.distros]]
|
||||
name = "<OS distribution name>"
|
||||
version = "<OS distribution version>"
|
||||
|
||||
[metadata]
|
||||
# extension-specific data
|
||||
```
|
||||
|
||||
Image extension authors MUST choose a globally unique ID, for example: "io.buildpacks.apt".
|
||||
|
||||
The image extension `id`, `version`, `api`, and `licenses` entries MUST follow the requirements defined in the [Buildpack Interface Specification](buildpack.md).
|
||||
|
||||
An extension descriptor MAY specify `targets` following the requirements defined in the [Buildpack Interface Specification](buildpack.md).
|
||||
|
||||
### extend-config.toml (TOML)
|
||||
|
||||
```toml
|
||||
[[build.args]]
|
||||
name = "<build arg name>"
|
||||
value = "<build arg value>"
|
||||
|
||||
[[run.args]]
|
||||
name = "<build arg name>"
|
||||
value = "<build arg value>"
|
||||
```
|
||||
|
||||
The image extension MAY specify any number of args.
|
||||
|
||||
For each arg, the image extension:
|
||||
- MUST specify a `name` to be the name of a build argument that will be provided to any output build.Dockerfile when extending the build base image.
|
||||
For each `[[build.args]]`, the image extension:
|
||||
- MUST specify a `name` to be the name of a build argument that will be provided to any output `build.Dockerfile` when extending the build base image.
|
||||
- MUST specify a `value` to be the value of the build argument that is provided.
|
||||
|
||||
For each `[[run.args]]`, the image extension:
|
||||
- MUST specify a `name` to be the name of a build argument that will be provided to any output `run.Dockerfile` when extending the runtime base image.
|
||||
- MUST specify a `value` to be the value of the build argument that is provided.
|
||||
|
||||
### Build Plan (TOML)
|
||||
|
|
787
platform.md
787
platform.md
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue