Search in sources :

Example 1 with DigestOnlyLayer

use of com.google.cloud.tools.jib.image.DigestOnlyLayer in project jib by google.

the class JsonToImageTranslator method toImage.

/**
 * Translates {@link V21ManifestTemplate} to {@link Image}.
 */
public static Image toImage(V21ManifestTemplate manifestTemplate) throws LayerPropertyNotFoundException {
    Image image = new Image();
    for (DescriptorDigest digest : manifestTemplate.getLayerDigests()) {
        Layer layer = new DigestOnlyLayer(digest);
        image.addLayer(layer);
    }
    return image;
}
Also used : DescriptorDigest(com.google.cloud.tools.jib.image.DescriptorDigest) DigestOnlyLayer(com.google.cloud.tools.jib.image.DigestOnlyLayer) Image(com.google.cloud.tools.jib.image.Image) ReferenceNoDiffIdLayer(com.google.cloud.tools.jib.image.ReferenceNoDiffIdLayer) Layer(com.google.cloud.tools.jib.image.Layer) ReferenceLayer(com.google.cloud.tools.jib.image.ReferenceLayer) DigestOnlyLayer(com.google.cloud.tools.jib.image.DigestOnlyLayer)

Aggregations

DescriptorDigest (com.google.cloud.tools.jib.image.DescriptorDigest)1 DigestOnlyLayer (com.google.cloud.tools.jib.image.DigestOnlyLayer)1 Image (com.google.cloud.tools.jib.image.Image)1 Layer (com.google.cloud.tools.jib.image.Layer)1 ReferenceLayer (com.google.cloud.tools.jib.image.ReferenceLayer)1 ReferenceNoDiffIdLayer (com.google.cloud.tools.jib.image.ReferenceNoDiffIdLayer)1