From 826f7ee4f23391abfce09198ffba4a1185e464e6 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 19 Oct 2016 02:14:12 -0700 Subject: [PATCH] config|manifest-list: Punt to runtime-spec for platform OS/arch The new wording makes it clear that implementations are free to support only a subset of OSes or architectures, and both implementations and blobs are free to support/use OSes and architectures not listed in runtime-spec. Leaning on runtime-spec here lets us consolidate any OCI GOOS/GOARCH extension in a single location (runtime-spec). I think it is unfortunate that the manifest-list and config types have inconsistent platform formats. It would be nice to give config the same 'platform' nesting as manifest-list, and to have both locations support os.version and the other settings which are currently only in manifest-list (or to drop those settings). But I'll leave fixing that for later work ;). Signed-off-by: W. Trevor King --- config.md | 10 ++++------ manifest-list.md | 9 ++++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/config.md b/config.md index 1782fc6ad..7ee028b58 100644 --- a/config.md +++ b/config.md @@ -60,16 +60,12 @@ Note: Any OPTIONAL field MAY also be set to null, which is equivalent to being a - **architecture** *string*, REQUIRED The CPU architecture which the binaries in this image are built to run on. - Possible values include: `386`, `amd64`, `arm`, `arm64`. - More values may be supported in the future and any of these may or may not be supported by a given container runtime implementation. - New entries SHOULD be submitted to this specification for standardization and be inspired by the [Go language documentation for $GOOS and $GOARCH](https://golang.org/doc/install/source#environment). + Configurations SHOULD use, and implementations SHOULD understand, values [supported by runtime-spec's `platform.arch`][runtime-platform]. - **os** *string*, REQUIRED The name of the operating system which the image is built to run on. - Possible values include: `darwin`, `freebsd`, `linux`. - More values may be supported in the future and any of these may or may not be supported by a given container runtime implementation. - New entries SHOULD be submitted to this specification for standardization and be inspired by the [Go language documentation for $GOOS and $GOARCH](https://golang.org/doc/install/source#environment). + Configurations SHOULD use, and implementations SHOULD understand, values [supported by runtime-spec's `platform.os`][runtime-platform]. - **config** *object*, OPTIONAL @@ -235,3 +231,5 @@ Here is an example image configuration JSON document: ] } ``` + +[runtime-platform]: https://github.com/opencontainers/runtime-spec/blob/v1.0.0-rc2/config.md#platform diff --git a/manifest-list.md b/manifest-list.md index 174e56306..cd6e7c2c6 100644 --- a/manifest-list.md +++ b/manifest-list.md @@ -38,15 +38,16 @@ This section defines the `application/vnd.oci.image.manifest.list.v1+json` [medi - **`platform`** *object* This REQUIRED property describes the platform which the image in the manifest runs on. - A full list of valid operating system and architecture values are listed in the [Go language documentation for `$GOOS` and `$GOARCH`](https://golang.org/doc/install/source#environment) - **`architecture`** *string* - This REQUIRED property specified the CPU architecture, for example `amd64` or `ppc64le`. + This REQUIRED property specified the CPU architecture. + Manifest lists SHOULD use, and implementations SHOULD understand, values [supported by runtime-spec's `platform.arch`][runtime-platform]. - **`os`** *string* - This REQUIRED property specifies the operating system, for example `linux` or `windows`. + This REQUIRED property specifies the operating system. + Manifest lists SHOULD use, and implementations SHOULD understand, values [supported by runtime-spec's `platform.os`][runtime-platform]. - **`os.version`** *string* @@ -117,3 +118,5 @@ Instead they MUST ignore unknown properties. } } ``` + +[runtime-platform]: https://github.com/opencontainers/runtime-spec/blob/v1.0.0-rc2/config.md#platform