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 <[email protected]>
  • Loading branch information
wking committed Oct 1, 2016
1 parent 5d4d777 commit 28a4a9d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ 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 array MUST have the base image at index 0.
Subsequent layers MUST then follow in stack order (i.e. from `layers[0]` to `layers[len(layers)]`).
Layers MUST must be [applied](layer.md#applying) in stack order (i.e. from `layers[0]` to `layers[len(layers)]`).
The final filesystem layout MUST match the result of [applying](layer.md#applying) the layers to an empty directory.
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 Descriptor `json:"config"`

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

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

0 comments on commit 28a4a9d

Please sign in to comment.