public static ImageMetadataOutput fromJibContainer(JibContainer jibContainer) {
    String image = jibContainer.getTargetImage().toString();
    String imageId = jibContainer.getImageId().toString();
    String imageDigest = jibContainer.getDigest().toString();
    Boolean imagePushed = jibContainer.isImagePushed();

    // Make sure tags always appear in a predictable way, by sorting them into a list
    List<String> tags = ImmutableList.sortedCopyOf(jibContainer.getTags());

    return new ImageMetadataOutput(image, imageId, imageDigest, tags, imagePushed);
  }
Create reproducible image build metadata from {@link JibContainer} information.

@param jibContainer the metadata source
@return a json template populated with image metadata
jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/ImageMetadataOutput.java