From d5850f85d327d5675e0731529b775b1f3ff624ab Mon Sep 17 00:00:00 2001 From: Jimil Desai Date: Mon, 1 Nov 2021 21:38:12 +0530 Subject: [PATCH 1/5] feat: build-image distribution spec Signed-off-by: Jimil Desai --- distribution.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/distribution.md b/distribution.md index 63f16a40..950a53e4 100644 --- a/distribution.md +++ b/distribution.md @@ -11,7 +11,11 @@ This document specifies the artifact format and the delivery mechanism for the b - [Distribution API Version](#distribution-api-version) - [Artifact Format](#artifact-format) - [Buildpackage](#buildpackage) +<<<<<<< HEAD - [Lifecycle](#lifecycle) +======= + - [Build Image](#build-image) +>>>>>>> feat: build-image distribution spec ## Distribution API Version @@ -155,3 +159,37 @@ Where: * contain an array of deprecated APIs: * should only contain `0.x` or major versions * should only contain APIs that correspond to a spec release +### Build Image + +The following defines how a `build-image` SHOULD be packaged for distribution as an OCI Image. The `build-image` is the component that provides the base image from which the build environment is constructed. + +The image configuration refers to the OCI Image configuration as mentioned [here](https://github.com/opencontainers/image-spec/blob/main/config.md#properties). + +#### Image Configuration + +The Build Image MUST contain the following configurations: + +* Image Config's `config.User` field MUST be set to a non-root user with a writable home directory. +* Image Config's `os` field MUST be set to the underlying operating system used by the build image. +* Image Config's `architecture` field MUST be set to the underlying operating system architecture used by the build image. + +The Build Image SHOULD contain the following configurations: + +* Image Config's `variant` field SHOULD be set to the underlying architecture variant. + +#### Environment Variables + +The Build Image MUST contain the following Environment Variables: + +* Image Config's `config.Env` field MUST have the environment variable `CNB_USER_ID` set to the user UID/SID of the user specified in the `User` field. +* Image Config's `config.Env` field MUST have the environment variable `CNB_GROUP_ID` set to the primary group GID/SID of the user specified in the `User` field. +* Image Config's `config.Env` field MUST have the environment variable `PATH` set to a valid set of paths or explicitly set to empty. (`PATH=`). + +#### Labels + +The Build Image SHOULD contain the following Labels on the image configuration: + +| Label | Description +|------- |------------ +| `io.buildpacks.distribution.name` | A string denoting the operating system distribution +| `io.buildpacks.distribution.version` | A string denoting the operating system version From c4bb0deb6f422921de7c4fb0b39394bf7ce4b9cf Mon Sep 17 00:00:00 2001 From: Jimil Desai Date: Wed, 3 Nov 2021 20:51:52 +0530 Subject: [PATCH 2/5] minor nits Signed-off-by: Jimil Desai --- distribution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distribution.md b/distribution.md index 950a53e4..cd113ad8 100644 --- a/distribution.md +++ b/distribution.md @@ -161,7 +161,7 @@ Where: * should only contain APIs that correspond to a spec release ### Build Image -The following defines how a `build-image` SHOULD be packaged for distribution as an OCI Image. The `build-image` is the component that provides the base image from which the build environment is constructed. +The following defines how a build image SHOULD be packaged for distribution as an OCI Image. The build image is the component that provides the base image from which the build environment is constructed. The image configuration refers to the OCI Image configuration as mentioned [here](https://github.com/opencontainers/image-spec/blob/main/config.md#properties). @@ -183,7 +183,7 @@ The Build Image MUST contain the following Environment Variables: * Image Config's `config.Env` field MUST have the environment variable `CNB_USER_ID` set to the user UID/SID of the user specified in the `User` field. * Image Config's `config.Env` field MUST have the environment variable `CNB_GROUP_ID` set to the primary group GID/SID of the user specified in the `User` field. -* Image Config's `config.Env` field MUST have the environment variable `PATH` set to a valid set of paths or explicitly set to empty. (`PATH=`). +* Image Config's `config.Env` field MUST have the environment variable `PATH` set to a valid set of paths or explicitly set to empty (`PATH=`). #### Labels From 7fddd7acd2cc8755f45f6dca83dee8d85826e7d0 Mon Sep 17 00:00:00 2001 From: Jimil Desai Date: Wed, 10 Nov 2021 23:26:36 +0530 Subject: [PATCH 3/5] update UID/SID with relevant footnotes Signed-off-by: Jimil Desai --- distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution.md b/distribution.md index cd113ad8..583284f4 100644 --- a/distribution.md +++ b/distribution.md @@ -181,7 +181,7 @@ The Build Image SHOULD contain the following configurations: The Build Image MUST contain the following Environment Variables: -* Image Config's `config.Env` field MUST have the environment variable `CNB_USER_ID` set to the user UID/SID of the user specified in the `User` field. +* Image Config's `config.Env` field MUST have the environment variable `CNB_USER_ID` set to the user [†](README.md#operating-system-conventions)UID/[‡](README.md#operating-system-conventions)SID of the user specified in the `User` field. * Image Config's `config.Env` field MUST have the environment variable `CNB_GROUP_ID` set to the primary group GID/SID of the user specified in the `User` field. * Image Config's `config.Env` field MUST have the environment variable `PATH` set to a valid set of paths or explicitly set to empty (`PATH=`). From 7f9b9b6249a24c478e895d80add9d42f10d8f0b8 Mon Sep 17 00:00:00 2001 From: Jimil Desai Date: Thu, 11 Nov 2021 18:59:00 +0530 Subject: [PATCH 4/5] update user field with UID/SID instead of username Signed-off-by: Jimil Desai --- distribution.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/distribution.md b/distribution.md index 583284f4..6843e1f6 100644 --- a/distribution.md +++ b/distribution.md @@ -169,20 +169,17 @@ The image configuration refers to the OCI Image configuration as mentioned [here The Build Image MUST contain the following configurations: -* Image Config's `config.User` field MUST be set to a non-root user with a writable home directory. +* Image Config's `config.User` field MUST be set to the user [†](README.md#operating-system-conventions)UID/[‡](README.md#operating-system-conventions)SID with a writable home directory. * Image Config's `os` field MUST be set to the underlying operating system used by the build image. * Image Config's `architecture` field MUST be set to the underlying operating system architecture used by the build image. - -The Build Image SHOULD contain the following configurations: - -* Image Config's `variant` field SHOULD be set to the underlying architecture variant. +* Image Config's `variant` field MUST be set to the underlying architecture variant. #### Environment Variables The Build Image MUST contain the following Environment Variables: * Image Config's `config.Env` field MUST have the environment variable `CNB_USER_ID` set to the user [†](README.md#operating-system-conventions)UID/[‡](README.md#operating-system-conventions)SID of the user specified in the `User` field. -* Image Config's `config.Env` field MUST have the environment variable `CNB_GROUP_ID` set to the primary group GID/SID of the user specified in the `User` field. +* Image Config's `config.Env` field MUST have the environment variable `CNB_GROUP_ID` set to the primary group [†](README.md#operating-system-conventions)GID/[‡](README.md#operating-system-conventions)SID of the user specified in the `User` field. * Image Config's `config.Env` field MUST have the environment variable `PATH` set to a valid set of paths or explicitly set to empty (`PATH=`). #### Labels From 24c2179b3772def8d9e7994a97c6bcf8973e465b Mon Sep 17 00:00:00 2001 From: Javier Romero Date: Mon, 29 Nov 2021 10:46:20 -0600 Subject: [PATCH 5/5] Update distribution.md Signed-off-by: Javier Romero --- distribution.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/distribution.md b/distribution.md index 6843e1f6..e2c4f5c0 100644 --- a/distribution.md +++ b/distribution.md @@ -11,12 +11,8 @@ This document specifies the artifact format and the delivery mechanism for the b - [Distribution API Version](#distribution-api-version) - [Artifact Format](#artifact-format) - [Buildpackage](#buildpackage) -<<<<<<< HEAD - [Lifecycle](#lifecycle) -======= - [Build Image](#build-image) ->>>>>>> feat: build-image distribution spec - ## Distribution API Version This document specifies Distribution API version `0.3`.