private static void applyHandlers(Containerizer containerizer, ConsoleLogger consoleLogger) {
    containerizer
        .addEventHandler(
            LogEvent.class,
            logEvent -> consoleLogger.log(logEvent.getLevel(), logEvent.getMessage()))
        .addEventHandler(
            ProgressEvent.class,
            new ProgressEventHandler(
                update -> {
                  List<String> footer =
                      ProgressDisplayGenerator.generateProgressDisplay(
                          update.getProgress(), update.getUnfinishedLeafTasks());
                  footer.add("");
                  consoleLogger.setFooter(footer);
                }));
  }
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