Class V21ManifestTemplate

  • All Implemented Interfaces:
    ManifestTemplate, JsonTemplate

    public class V21ManifestTemplate
    extends java.lang.Object
    implements ManifestTemplate
    JSON template for Docker Manifest Schema V2.1

    This 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 and history 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 Detail

      • V21ManifestTemplate

        public V21ManifestTemplate()
    • 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.
      • 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 format application/vnd.docker.container.image.v1+json) from the v1Compatibility value of the first history entry, which corresponds to the latest layer.
        Returns:
        container configuration if the first history string holds it; null otherwise