This section describes how to store component versions in a file format.
There is no dedicated file format for OCM content. Instead, the OCI registry mapping is reused to represent OCI content in a filesystem structure. This way the Common Transport Format is defined for general OCI content and can be used to transport OCI as well as OCM content.
To describe a repository context for an OCM repository conforming to this specification the following repository specification format MUST be used.
type: CommonTransportFormat[/VERSION]
[ATTRIBUTES]
An OCM repository view will be mapped to a filesystem-based representation according to the Common Transport Format specification.
Supported specification version is v1
.
The type specific specification fields are:
-
filePath
stringThe path in the filesystem used to store the content
-
fileFormat
stringThe file format to use:
directory
: stored as file hierarchy in a directorytar
: stored as file hierarchy in a TAR filetgz
: stored as file hierarchy in a GNU-zipped TAR file (tgz)
-
accessMode
(optional) byteAccess mode used to access the content:
- 0: write access
- 1: read-only
- 2: create id not existent, yet
This format uses the OCIRegistry
element mapping to map OCM elements to OCI elements. Those elements will then be stored according to the OCI mapping to filesystem content.
This format supports no dedicated blob mappings. Local blobs are always stored as blobs.
artifact-archive
├── artifact-index.json
└── blobs
├── sha.123... (manifest.json)
├── sha.234... (config.json)
├── sha.345... (layer 0: component descriptor)
├── sha.456... (local blob / transport archive of a previously external resource)
└── sha.567... (local blob / transport archive of a previously external resource)
The component version appears in the archive-descriptor.json as a tag associated to the digest of the component descriptor:
{
"schemaVersion": 1,
"artifacts": [
{
"repository": "component-descriptors/<component name>>",
"tag": "0.1.0",
"digest": "sha256:123..."
}
]
}
transport-archive
├── artifact-descriptor.json
└── blobs
├── sha256.111... (manifest.json of artifact 1)
├── sha256.222... (config.json of artifact 1)
├── sha256.333... (layer of artifact 1)
├── sha256.444... (layer of artifact 1)
├── sha256.555... (manifest.json of artifact 2)
├── sha256.666... (config.json of artifact 2)
├── sha256.777... (layer of artifact 2)
└── sha256.888... (layer of artifact 2)
The manifest list in the artifact-descriptor.json
contains the tags for the two manifests:
{
"schemaVersion": 1,
"artifacts": [
{
"repository": "component-descriptors/<name of first component>",
"tag": "0.1.0",
"digest": "sha256:111..."
},
{
"repository": "component-descriptors/<name of second component>",
"tag": "0.1.6",
"digest": "sha256:555..."
}
]
}