public static Containerizer to(TarImage tarImage) {
    Optional<ImageReference> imageReference = tarImage.getImageReference();
    if (!imageReference.isPresent()) {
      throw new IllegalArgumentException(
          "Image name must be set when building a TarImage; use TarImage#named(...) to set the name"
              + " of the target image");
    }

    ImageConfiguration imageConfiguration =
        ImageConfiguration.builder(imageReference.get()).build();

    Function<BuildContext, StepsRunner> stepsRunnerFactory =
        buildContext -> StepsRunner.begin(buildContext).tarBuildSteps(tarImage.getPath());

    return new Containerizer(
        DESCRIPTION_FOR_TARBALL, imageConfiguration, stepsRunnerFactory, false);
  }
Gets a new {@link Containerizer} that containerizes to a tarball archive.

@param tarImage the {@link TarImage} that defines target output file
@return a new {@link Containerizer}
jib-core/src/main/java/com/google/cloud/tools/jib/api/Containerizer.java