Skip to content

Commit 39fd7ec

Browse files
authored
Merge pull request #50 from atlaskerr/oci-examples
Replace vendor-specific examples and links
2 parents c574672 + d93cfa5 commit 39fd7ec

File tree

1 file changed

+85
-70
lines changed

1 file changed

+85
-70
lines changed

spec.md

Lines changed: 85 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ For detail on individual endpoints, please see the [_Detail_](#detail) section.
173173

174174
Actionable failure conditions, covered in detail in their relevant sections, are reported as part of 4xx responses, in a json response body.
175175
One or more errors will be returned in the following format:
176-
176+
```JSON
177177
{
178178
"errors:" [{
179179
"code": <error identifier>,
@@ -183,6 +183,7 @@ One or more errors will be returned in the following format:
183183
...
184184
]
185185
}
186+
```
186187

187188
The `code` field will be a unique identifier, all caps with underscores by convention.
188189
The `message` field will be a human readable string.
@@ -285,16 +286,7 @@ An "image" is a combination of a JSON manifest and individual layer files.
285286
The process of pulling an image centers around retrieving these two components.
286287

287288
The first step in pulling an image is to retrieve the manifest.
288-
For reference, the relevant manifest fields for the registry are the following:
289-
290-
| field | description |
291-
|-----------|------------------------------------------------|
292-
| name | The name of the image. |
293-
| tag | The tag for this version of the image. |
294-
| fsLayers | A list of layer descriptors (including digest) |
295-
| signature | A JWS used to verify the manifest content |
296-
297-
For more information about the manifest format, please see [moby/moby#8093](https://github.com/moby/moby/issues/8093).
289+
For details on manifest formats and their content types, refer to the OCI Image Specification's [manifest property description](https://github.com/opencontainers/image-spec/blob/master/manifest.md#image-manifest-property-descriptions).
298290

299291
When the manifest is in hand, the client MUST verify the signature to ensure the names and layers are valid.
300292
Once confirmed, the client will then use the digests to download the individual layers.
@@ -312,26 +304,31 @@ The `name` and `reference` parameter identify the image and are REQUIRED.
312304
The reference MAY include a tag or digest.
313305

314306
The client SHOULD include an Accept header indicating which manifest content types it supports.
315-
For more details on the manifest formats and their content types, see [manifest-v2-1.md](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-1.md) and [manifest-v2-2.md](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md).
316307
In a successful response, the Content-Type header will indicate which manifest type is being returned.
317308

318309
A `404 Not Found` response will be returned if the image is unknown to the registry.
319-
If the image exists and the response is successful, the image manifest will be returned, with the following format (see [moby/moby#8093](https://github.com/moby/moby/issues/8093) for details):
310+
If the image exists and the response is successful, the image manifest will be returned:
320311

321312
```json
322-
{
323-
"name": <name>,
324-
"tag": <tag>,
325-
"fsLayers": [
326-
{
327-
"blobSum": <digest>
328-
},
329-
...
330-
]
331-
],
332-
"history": <v1 images>,
333-
"signature": <JWS>
334-
}
313+
{
314+
"annotations": {
315+
"com.example.key1": "value1",
316+
"com.example.key2": "value2"
317+
},
318+
"config": {
319+
"digest": "sha256:6f4e69a5ff18d92e7315e3ee31c62165ebf25bfa05cad05c0d09d8f412dae401",
320+
"mediaType": "application/vnd.oci.image.config.v1+json",
321+
"size": 452
322+
},
323+
"layers": [
324+
{
325+
"digest": "sha256:6f4e69a5ff18d92e7315e3ee31c62165ebf25bfa05cad05c0d09d8f412dae401",
326+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
327+
"size": 78343
328+
}
329+
],
330+
"schemaVersion": 2
331+
}
335332
```
336333

337334
The client SHOULD verify the returned manifest signature for authenticity before fetching layers.
@@ -657,23 +654,28 @@ Once all of the layers for an image are uploaded, the client can upload the imag
657654
An image can be pushed using the following request format:
658655

659656
```HTTP
660-
PUT /v2/<name>/manifests/<reference>
661-
Content-Type: <manifest media type>
657+
PUT /v2/<name>/manifests/<reference>
658+
Content-Type: <manifest media type>
662659
663-
{
664-
"name": <name>,
665-
"tag": <tag>,
666-
"fsLayers": [
667-
{
668-
"blobSum": <digest>
669-
},
670-
...
671-
]
672-
],
673-
"history": <v1 images>,
674-
"signature": <JWS>,
675-
...
676-
}
660+
{
661+
"annotations": {
662+
"com.example.key1": "value1",
663+
"com.example.key2": "value2"
664+
},
665+
"config": {
666+
"digest": "sha256:6f4e69a5ff18d92e7315e3ee31c62165ebf25bfa05cad05c0d09d8f412dae401",
667+
"mediaType": "application/vnd.oci.image.config.v1+json",
668+
"size": 452
669+
},
670+
"layers": [
671+
{
672+
"digest": "sha256:6f4e69a5ff18d92e7315e3ee31c62165ebf25bfa05cad05c0d09d8f412dae401",
673+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
674+
"size": 78343
675+
}
676+
],
677+
"schemaVersion": 2
678+
}
677679
```
678680

679681
The `name` and `reference` fields of the response body MUST match those specified in the URL.
@@ -687,7 +689,7 @@ If one or more layers are unknown to the registry, `BLOB_UNKNOWN` errors are ret
687689
The `detail` field of the error response will have a `digest` field identifying the missing blob.
688690
An error is returned for each unknown blob.
689691
The response format is as follows:
690-
692+
```JSON
691693
{
692694
"errors:" [{
693695
"code": "BLOB_UNKNOWN",
@@ -699,6 +701,7 @@ The response format is as follows:
699701
...
700702
]
701703
}
704+
```
702705

703706
### Listing Repositories
704707

@@ -820,16 +823,16 @@ The tags for an image repository can be retrieved with the following request:
820823
The response will be in the following format:
821824

822825
```HTTP
823-
200 OK
824-
Content-Type: application/json
826+
200 OK
827+
Content-Type: application/json
825828
826-
{
827-
"name": <name>,
828-
"tags": [
829-
<tag>,
830-
...
831-
]
832-
}
829+
{
830+
"name": <name>,
831+
"tags": [
832+
<tag>,
833+
...
834+
]
835+
}
833836
```
834837

835838
For repositories with a large number of tags, this response MAY be quite large.
@@ -1450,17 +1453,23 @@ Docker-Content-Digest: <digest>
14501453
Content-Type: <media type of manifest>
14511454
14521455
{
1453-
"name": <name>,
1454-
"tag": <tag>,
1455-
"fsLayers": [
1456+
"annotations": {
1457+
"com.example.key1": "value1",
1458+
"com.example.key2": "value2"
1459+
},
1460+
"config": {
1461+
"digest": "sha256:6f4e69a5ff18d92e7315e3ee31c62165ebf25bfa05cad05c0d09d8f412dae401",
1462+
"mediaType": "application/vnd.oci.image.config.v1+json",
1463+
"size": 452
1464+
},
1465+
"layers": [
14561466
{
1457-
"blobSum": "<digest>"
1458-
},
1459-
...
1460-
]
1467+
"digest": "sha256:6f4e69a5ff18d92e7315e3ee31c62165ebf25bfa05cad05c0d09d8f412dae401",
1468+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
1469+
"size": 78343
1470+
}
14611471
],
1462-
"history": <v1 images>,
1463-
"signature": <JWS>
1472+
"schemaVersion": 2
14641473
}
14651474
```
14661475

@@ -1645,17 +1654,23 @@ Authorization: <scheme> <token>
16451654
Content-Type: <media type of manifest>
16461655
16471656
{
1648-
"name": <name>,
1649-
"tag": <tag>,
1650-
"fsLayers": [
1657+
"annotations": {
1658+
"com.example.key1": "value1",
1659+
"com.example.key2": "value2"
1660+
},
1661+
"config": {
1662+
"digest": "sha256:6f4e69a5ff18d92e7315e3ee31c62165ebf25bfa05cad05c0d09d8f412dae401",
1663+
"mediaType": "application/vnd.oci.image.config.v1+json",
1664+
"size": 452
1665+
},
1666+
"layers": [
16511667
{
1652-
"blobSum": "<digest>"
1653-
},
1654-
...
1655-
]
1668+
"digest": "sha256:6f4e69a5ff18d92e7315e3ee31c62165ebf25bfa05cad05c0d09d8f412dae401",
1669+
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
1670+
"size": 78343
1671+
}
16561672
],
1657-
"history": <v1 images>,
1658-
"signature": <JWS>
1673+
"schemaVersion": 2
16591674
}
16601675
```
16611676

0 commit comments

Comments
 (0)