Skip to content

Commit 933f917

Browse files
authored
Merge pull request #1042 from sudo-bmitch/pr-scratch-var
Rename the scratch variable and layer requirements
2 parents 2879913 + fd45b6b commit 933f917

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

manifest.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,22 @@ Unlike the [image index](image-index.md), which contains information about a set
5353
While an empty blob (`size` of 0) may be preferable, practice has shown that not to be ubiquitiously supported.
5454
Instead, the blob payload can be the most minimal content that is still valid JSON object: `{}` (`size` of 2).
5555
The blob digest of `{}` is `sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`.
56-
See the [example SCRATCH config](#example-of-a-scratch-config-or-layer-descriptor) below, and the `ScratchDescriptor()` of the reference code.
56+
See the [example SCRATCH config](#example-of-a-scratch-config-or-layer-descriptor) below, and `ScratchDescriptor` of the reference code.
5757

5858
- **`layers`** *array of objects*
5959

6060
Each item in the array MUST be a [descriptor](descriptor.md).
61-
The array MUST have the base layer at index 0.
62-
Subsequent layers MUST then follow in stack order (i.e. from `layers[0]` to `layers[len(layers)-1]`).
63-
The final filesystem layout MUST match the result of [applying](layer.md#applying-changesets) the layers to an empty directory.
64-
The [ownership, mode, and other attributes](layer.md#file-attributes) of the initial empty directory are unspecified.
61+
For portability, `layers` SHOULD have at least one entry.
62+
63+
When the `config.mediaType` is set to `application/vnd.oci.image.config.v1+json`, the following additional restrictions apply:
64+
65+
- The array MUST have the base layer at index 0.
66+
- Subsequent layers MUST then follow in stack order (i.e. from `layers[0]` to `layers[len(layers)-1]`).
67+
- The final filesystem layout MUST match the result of [applying](layer.md#applying-changesets) the layers to an empty directory.
68+
- The [ownership, mode, and other attributes](layer.md#file-attributes) of the initial empty directory are unspecified.
6569

6670
For broad portability, if a layer is required to be used, use the SCRATCH layer.
67-
See the [example SCRATCH layer](#example-of-a-scratch-config-or-layer-descriptor) below, and the `ScratchDescriptor()` of the reference code.
71+
See the [example SCRATCH layer](#example-of-a-scratch-config-or-layer-descriptor) below, and `ScratchDescriptor` of the reference code.
6872

6973
Beyond the [descriptor requirements](descriptor.md#properties), the value has the following additional restrictions:
7074

specs-go/v1/manifest.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ type Manifest struct {
4040
Annotations map[string]string `json:"annotations,omitempty"`
4141
}
4242

43-
// ScratchDigestSHA256 is the digest of a blob with content of `{}` (size of 2)
44-
const ScratchDigestSHA256 = `sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`
45-
const ScratchDigestData = `{}`
43+
// ScratchDescriptor is the descriptor of a blob with content of `{}`.
44+
var ScratchDescriptor = Descriptor{
45+
MediaType: MediaTypeScratch,
46+
Digest: `sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`,
47+
Size: 2,
48+
Data: []byte(`{}`),
49+
}

0 commit comments

Comments
 (0)