Skip to content

Commit

Permalink
manifest: Explicitly make 'layers' optional
Browse files Browse the repository at this point in the history
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]: opencontainers#313 (comment)

Signed-off-by: W. Trevor King <wking@tremily.us>
  • Loading branch information
wking committed Sep 16, 2016
1 parent 89131b7 commit 43d2e9a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ Unlike the [Manifest List](#manifest-list), which contains information about a s

- **`layers`** *array*

This OPTIONAL property references the [layers](layer.md) defining the container's root filesystem.
Each item in the array MUST be a [descriptor](descriptor.md).
The root filesystem MUST match the result of [applying](layer.md#applying) the entries to an empty directory in the listed order.
The [ownership, mode, and other attributes](layer.md#file-attributes) of the initial empty directory are unspecified.
Expand Down
3 changes: 1 addition & 2 deletions schema/image-manifest-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"required": [
"schemaVersion",
"mediaType",
"config",
"layers"
"config"
]
}
2 changes: 1 addition & 1 deletion specs-go/v1/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Manifest struct {
Config specs.Descriptor `json:"config"`

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

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

0 comments on commit 43d2e9a

Please sign in to comment.