Class OciIndexTemplate
- java.lang.Object
-
- com.google.cloud.tools.jib.image.json.OciIndexTemplate
-
- All Implemented Interfaces:
ManifestListTemplate
,ManifestTemplate
,JsonTemplate
public class OciIndexTemplate extends java.lang.Object implements ManifestListTemplate
JSON template for OCI archive "index.json" file.Example manifest JSON:
{ "schemaVersion": 2, "mediaType": "application/vnd.oci.image.index.v1+json", "manifests": [ { "mediaType": "application/vnd.oci.image.manifest.v1+json", "digest": "sha256:e684b1dceef404268f17d4adf7f755fd9912b8ae64864b3954a83ebb8aa628b3", "size": 1132, "platform": { "architecture": "ppc64le", "os": "linux" }, "annotations": { "org.opencontainers.image.ref.name": "gcr.io/project/image:tag" } } ] }
- See Also:
- OCI Image Index Specification
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OciIndexTemplate.ManifestDescriptorTemplate
Template for inner JSON object representing a single platform specific manifest.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MEDIA_TYPE
The OCI Index media type.
-
Constructor Summary
Constructors Constructor Description OciIndexTemplate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addManifest(BlobDescriptor descriptor, java.lang.String imageReferenceName)
Adds a manifest reference with the givenBlobDescriptor
.void
addManifest(OciIndexTemplate.ManifestDescriptorTemplate manifest)
Adds a manifest.java.util.List<java.lang.String>
getDigestsForPlatform(java.lang.String architecture, java.lang.String os)
Returns a list of digests for a specific platform found in the manifest list.java.lang.String
getManifestMediaType()
java.util.List<OciIndexTemplate.ManifestDescriptorTemplate>
getManifests()
int
getSchemaVersion()
-
-
-
Field Detail
-
MEDIA_TYPE
public static final java.lang.String MEDIA_TYPE
The OCI Index media type.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSchemaVersion
public int getSchemaVersion()
- Specified by:
getSchemaVersion
in interfaceManifestTemplate
-
getManifestMediaType
public java.lang.String getManifestMediaType()
- Specified by:
getManifestMediaType
in interfaceManifestTemplate
-
addManifest
public void addManifest(BlobDescriptor descriptor, java.lang.String imageReferenceName)
Adds a manifest reference with the givenBlobDescriptor
.- Parameters:
descriptor
- the manifest blob descriptorimageReferenceName
- the image reference name
-
addManifest
public void addManifest(OciIndexTemplate.ManifestDescriptorTemplate manifest)
Adds a manifest.- Parameters:
manifest
- a manifest descriptor
-
getManifests
public java.util.List<OciIndexTemplate.ManifestDescriptorTemplate> getManifests()
-
getDigestsForPlatform
public java.util.List<java.lang.String> getDigestsForPlatform(java.lang.String architecture, java.lang.String os)
Description copied from interface:ManifestListTemplate
Returns a list of digests for a specific platform found in the manifest list. see https://docs.docker.com/registry/spec/manifest-v2-2/#manifest-list- Specified by:
getDigestsForPlatform
in interfaceManifestListTemplate
- Parameters:
architecture
- the architecture of the target platformos
- the os of the target platform- Returns:
- a list of matching digests
-
-