Skip to content

Commit a099d77

Browse files
committed
Update RFC96 to match what landed in the spec
A few changes were made to what was in the RFC when it came to update the spec. This backports those changes to the RFC to try and prevent user confusion if they use the RFC as a means of learning about targets when implementing. Specifically, the spec renamed `io.buildpacks.distributions.*` to `io.buildpacks.distros.*`, and similarly renamed the `buildpack.toml` table `[[targets.distributions]]` to `[[targets.distros]]`. Lastly, `io.buildpacks.id` was renamed to `io.buildpacks.base.id`. See: https://github.com/buildpacks/spec/blob/platform/0.13/platform.md#target-data Signed-off-by: Ed Morley <[email protected]>
1 parent ce8991b commit a099d77

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

text/0096-remove-stacks-mixins.md

+26-10
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ Instead of a stack ID, runtime and build-time base images must contain the follo
4141
- OS (e.g., "linux", `$GOOS`), specified as `os` in the base image `config`
4242
- Architecture (e.g., "arm", `$GOARCH`), specified as `architecture` in the base image `config`
4343
- Architecture Variant (optional) (e.g., "v6", `$GOARM`), specified as `variant` in the base image `config`
44-
- Distribution (optional) (e.g., "ubuntu", `$ID`), specified as a label `io.buildpacks.distribution.name`
45-
- Version (optional) (e.g., "18.04", `$VERSION_ID`), specified as a label `io.buildpacks.distribution.version`
44+
- Distribution (optional) (e.g., "ubuntu", `$ID`), specified as a label `io.buildpacks.distros.name`
45+
- Version (optional) (e.g., "18.04", `$VERSION_ID`), specified as a label `io.buildpacks.distros.version`
4646

4747
Additionally, the runtime base may contain the following metadata:
48-
- Target ID (optional) (e.g., "minimal"), specified as a label `io.buildpacks.id`
48+
- Target ID (optional) (e.g., "minimal"), specified as a label `io.buildpacks.base.id`
4949

5050
OS, Architecture, and Architecture Variant must be valid identifiers as defined in the [OCI Image specification](https://github.com/opencontainers/image-spec/blob/main/config.md).
5151

5252
Target ID is an identifier specified on the runtime base image that must be provided to buildpacks as `CNB_TARGET_ID` during the build process.
5353
This allows buildpacks to change their behavior if a run image is selected (e.g., distroless) that has special properties outside of OS, architecture, etc.
5454

5555
For Linux-based images, each field should be canonicalized against values specified in `/etc/os-release` (`$ID` and `$VERSION_ID`).
56-
The `os.version` field in an base image `config` may contain combined distribution and version information, but it is not used by the lifecycle.
56+
The `os.version` field in a base image `config` may contain combined distribution and version information, but it is not used by the lifecycle.
5757

5858
For Windows-based images, Distribution should be empty. Version should be the [suggested value of `os.version`](https://github.com/opencontainers/image-spec/blob/main/config.md#properties) in the OCI spec (e.g., `10.0.14393.1066`).
5959

@@ -81,15 +81,15 @@ versions = ["18.04", "20.04"]
8181
[[targets]]
8282
os = "linux"
8383
arch = "amd64"
84-
[[targets.distributions]]
84+
[[targets.distros]]
8585
name = "ubuntu"
8686
versions = ["14.04", "16.04"]
8787

8888
[[targets]]
8989
os = "linux"
9090
arch = "arm"
9191
variant = "v6"
92-
[[targets.distributions]]
92+
[[targets.distros]]
9393
name = "ubuntu"
9494
versions = ["14.04", "16.04"]
9595
```
@@ -153,11 +153,11 @@ If the newly-specified field values are missing, the lifecycle and pack may used
153153
```
154154
config.os = "linux"
155155
config.architecture = "amd64"
156-
io.buildpacks.distribution.name = "ubuntu"
157-
io.buildpacks.distribution.version = "18.04"
156+
io.buildpacks.base.distros.name = "ubuntu"
157+
io.buildpacks.base.distros.version = "18.04"
158158
```
159159

160-
Moving forward it's encouraged for buildpack authors to support both `[[stacks]]` and `[[targets]]` sections in `buildpack.toml` for maximum compatibility. In order to ease this process for those using the `io.buildpacks.stacks.bionic`, lifecycle will translate any section that sets this as on of the `stacks`:
160+
Moving forward it's encouraged for buildpack authors to support both `[[stacks]]` and `[[targets]]` sections in `buildpack.toml` for maximum compatibility. In order to ease this process for those using the `io.buildpacks.stacks.bionic`, lifecycle will translate any section that sets this as one of the `stacks`:
161161

162162
```toml
163163
[[stacks]]
@@ -170,7 +170,7 @@ to
170170
[[targets]]
171171
os = "linux"
172172
arch = "amd64"
173-
[[targets.distributions]]
173+
[[targets.distros]]
174174
name = "ubuntu"
175175
versions = ["18.04"]
176176
```
@@ -210,3 +210,19 @@ rename x86_64 -> amd64 in keeping with all other usages of arch. descriptors.
210210
### Motivation
211211

212212
This is how we do it everywhere else, this is the way.
213+
214+
## Amended
215+
### Meta
216+
[meta-1]: #meta-1
217+
- Name: Rename Docker labels and `buildpack.toml` table names
218+
- Start Date: 2024-04-08
219+
- Author(s): @edmorley
220+
- Amendment Pull Request: [rfcs#310](https://github.com/buildpacks/rfcs/pull/310)
221+
222+
### Summary
223+
224+
Changes were made to the Docker label and `buildpack.toml` table names between when this RFC was written and the changes were made to the spec in [spec#365](https://github.com/buildpacks/spec/pull/365), which have been backported to the RFC. In particular, the `io.buildpacks.distributions.*` Docker labels were renamed to `io.buildpacks.base.distros.*`, and the `buildpack.toml` table `[[targets.distributions]]` to `[[targets.distros]]`.
225+
226+
### Motivation
227+
228+
To prevent use of the wrong Docker label or `buildpack.toml` table names, if users base their implementations on the RFC rather than reading the spec.

0 commit comments

Comments
 (0)