public static Containerizer from(
      CommonCliOptions commonCliOptions, ConsoleLogger logger, CacheDirectories cacheDirectories)
      throws InvalidImageReferenceException, FileNotFoundException {
    Containerizer containerizer = create(commonCliOptions, logger);

    applyHandlers(containerizer, logger);
    applyConfiguration(containerizer, commonCliOptions, cacheDirectories);

    return containerizer;
  }
@Test
  public void testApplyConfiguration_defaults()
      throws InvalidImageReferenceException, FileNotFoundException,
          CacheDirectoryCreationException {
    CommonCliOptions commonCliOptions =
        CommandLine.populateCommand(new CommonCliOptions(), "-t", "test-image-ref");
    ContainerizerTestProxy containerizer =
        new ContainerizerTestProxy(
            Containerizers.from(commonCliOptions, consoleLogger, cacheDirectories));

    assertThat(Boolean.getBoolean(JibSystemProperties.SEND_CREDENTIALS_OVER_HTTP)).isFalse();
    assertThat(Boolean.getBoolean(JibSystemProperties.SERIALIZE)).isFalse();
    assertThat(containerizer.getToolName()).isEqualTo(VersionInfo.TOOL_NAME);
    assertThat(containerizer.getToolVersion()).isEqualTo(VersionInfo.getVersionSimple());
    assertThat(Boolean.getBoolean("sendCredentialsOverHttp")).isFalse();
    assertThat(containerizer.getAllowInsecureRegistries()).isFalse();
    assertThat(containerizer.getBaseImageLayersCacheDirectory()).isEqualTo(baseImageCache);
    assertThat(containerizer.getApplicationsLayersCacheDirectory()).isEqualTo(applicationCache);
    assertThat(containerizer.getAdditionalTags()).isEqualTo(ImmutableSet.of());
  }