Class ImageTarball


  • public class ImageTarball
    extends java.lang.Object
    Translates an Image to a tarball that can be loaded into Docker.
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageTarball​(Image image, ImageReference imageReference, com.google.common.collect.ImmutableSet<java.lang.String> allTargetImageTags)
      Instantiate with an Image.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getTotalLayerSize()
      Returns the total size of the image's layers in bytes.
      void writeTo​(java.io.OutputStream out)
      Writes image tar bar in configured Image.getImageFormat() of OCI or Docker to output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImageTarball

        public ImageTarball​(Image image,
                            ImageReference imageReference,
                            com.google.common.collect.ImmutableSet<java.lang.String> allTargetImageTags)
        Instantiate with an Image.
        Parameters:
        image - the image to convert into a tarball
        imageReference - image reference to set in the manifest (note that the tag portion of the image reference is ignored)
        allTargetImageTags - the tags to tag the image with
    • Method Detail

      • writeTo

        public void writeTo​(java.io.OutputStream out)
                     throws java.io.IOException
        Writes image tar bar in configured Image.getImageFormat() of OCI or Docker to output stream.
        Parameters:
        out - the target output stream
        Throws:
        java.io.IOException - if an error occurs writing out the image to stream
      • getTotalLayerSize

        public long getTotalLayerSize()
        Returns the total size of the image's layers in bytes.
        Returns:
        the total size of the image's layers in bytes