class JibContainerBuilder {

  @VisibleForTesting
  BuildContext toBuildContext(Containerizer containerizer) throws CacheDirectoryCreationException {
    return buildContextBuilder
        .setTargetImageConfiguration(containerizer.getImageConfiguration())
        .setAdditionalTargetImageTags(containerizer.getAdditionalTags())
        .setBaseImageLayersCacheDirectory(containerizer.getBaseImageLayersCacheDirectory())
        .setApplicationLayersCacheDirectory(containerizer.getApplicationLayersCacheDirectory())
        .setContainerConfiguration(containerConfigurationBuilder.build())
        .setLayerConfigurations(layerConfigurations)
        .setAllowInsecureRegistries(containerizer.getAllowInsecureRegistries())
        .setOffline(containerizer.isOfflineMode())
        .setToolName(containerizer.getToolName())
        .setToolVersion(containerizer.getToolVersion())
        .setExecutorService(containerizer.getExecutorService().orElse(null))
        .setEventHandlers(containerizer.buildEventHandlers())
        .setAlwaysCacheBaseImage(containerizer.getAlwaysCacheBaseImage())
        .build();
  }

    JibContainerBuilder(RegistryImage baseImage);
    JibContainerBuilder(DockerDaemonImage baseImage);
    JibContainerBuilder(TarImage baseImage);
  @VisibleForTesting  JibContainerBuilder(
      ImageConfiguration imageConfiguration, BuildContext.Builder buildContextBuilder);

}