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]: #313 (comment)

Signed-off-by: W. Trevor King <wking@tremily.us>
  • Loading branch information
wking committed Oct 1, 2016
1 parent 5d4d777 commit 57eb55c
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 @@ -157,6 +157,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 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)]`).
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 57eb55c

Please sign in to comment.