public static JibContainerBuilder toJibContainerBuilder(
      ArtifactProcessor processor,
      CommonCliOptions commonCliOptions,
      CommonContainerConfigCliOptions commonContainerConfigCliOptions,
      ConsoleLogger logger)
      throws IOException, InvalidImageReferenceException {
    String baseImage = commonContainerConfigCliOptions.getFrom().orElse("jetty");
    JibContainerBuilder containerBuilder =
        ContainerBuilders.create(baseImage, Collections.emptySet(), commonCliOptions, logger);
    List<String> programArguments = commonContainerConfigCliOptions.getProgramArguments();
    if (!commonContainerConfigCliOptions.getProgramArguments().isEmpty()) {
      containerBuilder.setProgramArguments(programArguments);
    }
    containerBuilder
        .setEntrypoint(computeEntrypoint(commonContainerConfigCliOptions))
        .setFileEntriesLayers(processor.createLayers())
        .setExposedPorts(commonContainerConfigCliOptions.getExposedPorts())
        .setVolumes(commonContainerConfigCliOptions.getVolumes())
        .setEnvironment(commonContainerConfigCliOptions.getEnvironment())
        .setLabels(commonContainerConfigCliOptions.getLabels());
    commonContainerConfigCliOptions.getUser().ifPresent(containerBuilder::setUser);
    commonContainerConfigCliOptions.getFormat().ifPresent(containerBuilder::setFormat);
    commonContainerConfigCliOptions.getCreationTime().ifPresent(containerBuilder::setCreationTime);

    return containerBuilder;
  }
Generates a {@link JibContainerBuilder} from contents of a WAR file.

@param processor artifact processor
@param commonCliOptions common cli options
@param commonContainerConfigCliOptions common cli options shared between jar and war command
@param logger console logger
@return JibContainerBuilder
@throws IOException if I/O error occurs when opening the war file or if temporary directory
    provided doesn't exist
@throws InvalidImageReferenceException if the base image reference is invalid
jib-cli/src/main/java/com/google/cloud/tools/jib/cli/war/WarFiles.java