private static void applyConfiguration(
      Containerizer containerizer,
      CommonCliOptions commonCliOptions,
      CacheDirectories cacheDirectories) {
    containerizer.setToolName(VersionInfo.TOOL_NAME);
    containerizer.setToolVersion(VersionInfo.getVersionSimple());

    // TODO: it's strange that we use system properties to set these
    // TODO: perhaps we should expose these as configuration options on the containerizer
    if (commonCliOptions.isSendCredentialsOverHttp()) {
      System.setProperty(JibSystemProperties.SEND_CREDENTIALS_OVER_HTTP, Boolean.TRUE.toString());
    }
    if (commonCliOptions.isSerialize()) {
      System.setProperty(JibSystemProperties.SERIALIZE, Boolean.TRUE.toString());
    }

    containerizer.setAllowInsecureRegistries(commonCliOptions.isAllowInsecureRegistries());
    cacheDirectories.getBaseImageCache().ifPresent(containerizer::setBaseImageLayersCache);
    containerizer.setApplicationLayersCache(cacheDirectories.getApplicationLayersCache());

    commonCliOptions.getAdditionalTags().forEach(containerizer::withAdditionalTag);
  }
Create a Containerizer from a command line specification.

@param commonCliOptions common cli options
@param logger a logger to inject into the build
@param cacheDirectories the location of the relevant caches for this build
@return a populated Containerizer
@throws InvalidImageReferenceException if the image reference could not be parsed
@throws FileNotFoundException if a credential helper file is not found
jib-cli/src/main/java/com/google/cloud/tools/jib/cli/Containerizers.java