Skip to content

Commit 43d2e9a

Browse files
committed
manifest: Explicitly make 'layers' optional
Most folks will distribute images containing layers, but the specified behavior applies cleanly to the layer-less case too. The unpacked rootfs will just be an empty directory with unspecified attributes. Folks might want to use that sort of thing for namespace pinning [1], distributing configs [2], setting up containers that mount the meat from the host [2], etc. [1]: opencontainers/runtime-spec#395 (comment) [2]: #313 (comment) Signed-off-by: W. Trevor King <[email protected]>
1 parent 89131b7 commit 43d2e9a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

manifest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ Unlike the [Manifest List](#manifest-list), which contains information about a s
139139

140140
- **`layers`** *array*
141141

142+
This OPTIONAL property references the [layers](layer.md) defining the container's root filesystem.
142143
Each item in the array MUST be a [descriptor](descriptor.md).
143144
The root filesystem MUST match the result of [applying](layer.md#applying) the entries to an empty directory in the listed order.
144145
The [ownership, mode, and other attributes](layer.md#file-attributes) of the initial empty directory are unspecified.

schema/image-manifest-schema.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"required": [
3131
"schemaVersion",
3232
"mediaType",
33-
"config",
34-
"layers"
33+
"config"
3534
]
3635
}

specs-go/v1/manifest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type Manifest struct {
2525
Config specs.Descriptor `json:"config"`
2626

2727
// Layers is an indexed list of layers referenced by the manifest.
28-
Layers []specs.Descriptor `json:"layers"`
28+
Layers []specs.Descriptor `json:"layers,omitempty"`
2929

3030
// Annotations contains arbitrary metadata for the manifest list.
3131
Annotations map[string]string `json:"annotations"`

0 commit comments

Comments
 (0)