Class V21ManifestTemplate
- java.lang.Object
-
- com.google.cloud.tools.jib.image.json.V21ManifestTemplate
-
- All Implemented Interfaces:
ManifestTemplate
,JsonTemplate
public class V21ManifestTemplate extends java.lang.Object implements ManifestTemplate
JSON template for Docker Manifest Schema V2.1This is only for parsing manifests in the older V2.1 schema. Generated manifests should be in the V2.2 schema using the
V22ManifestTemplate
.Example manifest JSON (only the
fsLayers
andhistory
fields are relevant for parsing):{ ... "fsLayers": { { "blobSum": "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" }, { "blobSum": "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" } }, "history": [ { "v1Compatibility": "<some manifest V1 JSON object>" } ] ... }
- See Also:
- Image Manifest Version 2, Schema 1
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MEDIA_TYPE
-
Constructor Summary
Constructors Constructor Description V21ManifestTemplate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<ContainerConfigurationTemplate>
getContainerConfiguration()
Attempts to parse the container configuration JSON (of formatapplication/vnd.docker.container.image.v1+json
) from thev1Compatibility
value of the firsthistory
entry, which corresponds to the latest layer.java.util.List<com.google.cloud.tools.jib.image.json.V21ManifestTemplate.LayerObjectTemplate>
getFsLayers()
java.util.List<DescriptorDigest>
getLayerDigests()
Returns a list of descriptor digests for the layers in the image.java.lang.String
getManifestMediaType()
int
getSchemaVersion()
-
-
-
Field Detail
-
MEDIA_TYPE
public static final java.lang.String MEDIA_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLayerDigests
public java.util.List<DescriptorDigest> getLayerDigests()
Returns a list of descriptor digests for the layers in the image.- Returns:
- a list of descriptor digests for the layers in the image.
-
getSchemaVersion
public int getSchemaVersion()
- Specified by:
getSchemaVersion
in interfaceManifestTemplate
-
getManifestMediaType
public java.lang.String getManifestMediaType()
- Specified by:
getManifestMediaType
in interfaceManifestTemplate
-
getFsLayers
public java.util.List<com.google.cloud.tools.jib.image.json.V21ManifestTemplate.LayerObjectTemplate> getFsLayers()
-
getContainerConfiguration
public java.util.Optional<ContainerConfigurationTemplate> getContainerConfiguration()
Attempts to parse the container configuration JSON (of formatapplication/vnd.docker.container.image.v1+json
) from thev1Compatibility
value of the firsthistory
entry, which corresponds to the latest layer.- Returns:
- container configuration if the first history string holds it;
null
otherwise
-
-