Skip to content

Commit 730ed2a

Browse files
author
Brandon Philips
committed
image-layout: initial commit
In order to build tooling that converts the set of OCI Image objects into an OCI Runtime object we need an Image Layout that test tools can be built around. Longer term this Image Layout could be used to define a "single object image" that is a tar/zip/etc that could be posted over https/ftp/etc. The layout comes from several different discussions: #23 #92 Signed-off-by: Brandon Philips <[email protected]>
1 parent d0e591d commit 730ed2a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

image-layout.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Open Container Initiative Image Layout Specification
2+
3+
The OCI Image Layout is a slash separated layout of OCI content-addressable
4+
This layout MAY be used in a variety of different transport mechanisms from archive formats (e.g. tar, zip) or used in shared filesystem environments (e.g. nfs) or in networked file fetching systems (e.g. http, ftp, rsync).
5+
Given an image layout a tool can convert a given ref into a runnable OCI Image Format by finding an appopriate manifest from the manifest list, unpacking the filesystem serializations in the correct order, and then converting the image configuration into an OCI Runtime config.json.
6+
7+
The image layout has two top level directories:
8+
9+
- "blobs" contains content-addressable blobs
10+
- "refs" contains descriptors pointing to an image manifest list
11+
12+
This is an example image layout:
13+
14+
```
15+
$ cd example.com/app/
16+
$ find .
17+
.
18+
./blobs
19+
./blobs/sha256:afff3924849e458c5ef237db5f89539274d5e609db5db935ed3959c90f1f2d51
20+
./blobs/sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270
21+
./blobs/sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f
22+
./refs
23+
./refs/v1.0
24+
./refs/v1.1
25+
```
26+
27+
The blobs directory MAY contain objects which are not referenced by any of the refs.
28+
Each object in the refs subdirectory MUST be of type `application/vnd.oci.descriptor.v1+json`.
29+
And the `mediatype` of this descriptor object SHOULD be `application/vnd.oci.image.manifest.list.v1+json` although future versions of the spec may use a different mediatype.
30+
31+
This illustrates the expected contents of a given ref and the manifest list it points to.
32+
33+
```
34+
$ cat ./refs/v1.0
35+
{"size": 4096, "digest": "sha256:afff3924849e458c5ef237db5f89539274d5e609db5db935ed3959c90f1f2d51", "mediatype": "application/vnd.oci.image.manifest.list.v1+json"}
36+
```
37+
```
38+
$ cat ./blobs/sha256:afff3924849e458c5ef237db5f89539274d5e609db5db935ed3959c90f1f2d51
39+
{
40+
"schemaVersion": 2,
41+
"mediaType": "application/vnd.oci.image.manifest.list.v1+json",
42+
"manifests": [
43+
{
44+
...
45+
```

0 commit comments

Comments
 (0)