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;
  }
@Test
  public void testToJibContainerBuilder_explodedStandard_basicInfo()
      throws IOException, InvalidImageReferenceException {
    FileEntriesLayer layer =
        FileEntriesLayer.builder()
            .setName("classes")
            .addEntry(
                Paths.get("path/to/tempDirectory/WEB-INF/classes/class1.class"),
                AbsoluteUnixPath.get("/my/app/WEB-INF/classes/class1.class"))
            .build();
    when(mockStandardWarExplodedProcessor.createLayers()).thenReturn(Arrays.asList(layer));
    when(mockCommonContainerConfigCliOptions.isJettyBaseimage()).thenReturn(true);

    JibContainerBuilder containerBuilder =
        WarFiles.toJibContainerBuilder(
            mockStandardWarExplodedProcessor,
            mockCommonCliOptions,
            mockCommonContainerConfigCliOptions,
            mockLogger);
    ContainerBuildPlan buildPlan = containerBuilder.toContainerBuildPlan();

    assertThat(buildPlan.getBaseImage()).isEqualTo("jetty");
    assertThat(buildPlan.getEntrypoint())
        .containsExactly("java", "-jar", "/usr/local/jetty/start.jar", "--module=ee10-deploy")
        .inOrder();
    assertThat(buildPlan.getLayers()).hasSize(1);
    assertThat(buildPlan.getLayers().get(0).getName()).isEqualTo("classes");
    assertThat(((FileEntriesLayer) buildPlan.getLayers().get(0)).getEntries())
        .containsExactlyElementsIn(
            FileEntriesLayer.builder()
                .addEntry(
                    Paths.get("path/to/tempDirectory/WEB-INF/classes/class1.class"),
                    AbsoluteUnixPath.get("/my/app/WEB-INF/classes/class1.class"))
                .build()
                .getEntries());
  }