public static void buildContainer(JibContainerBuilder jibContainerBuilder, TarImage image, Logger logger)
            throws InterruptedException {

        final ExecutorService jibBuildExecutor = Executors.newCachedThreadPool();
        try {
            jibContainerBuilder.setCreationTime(Instant.now());
            jibContainerBuilder.containerize(Containerizer.to(image)
                    .setAllowInsecureRegistries(true)
                    .setExecutorService(jibBuildExecutor)
                    .addEventHandler(LogEvent.class, log(logger))
                    .addEventHandler(ProgressEvent.class, new ProgressEventHandler(logUpdate())));
            logUpdateFinished();
        } catch (CacheDirectoryCreationException | IOException | ExecutionException | RegistryException ex) {
            logger.error("Unable to build the image tarball: ", ex);
            throw new IllegalStateException(ex);
        } catch (InterruptedException ex) {
            Thread.currentThread().interrupt();
            throw ex;
        } finally {
            jibBuildExecutor.shutdown();
            jibBuildExecutor.awaitTermination(JIB_EXECUTOR_SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS);
        }
    }
Build container image using JIB

@param jibContainerBuilder jib container builder object
@param image tarball for image
@param logger kit logger
@throws InterruptedException in case thread is interrupted
src/main/java/io/fabric8/maven/docker/util/JibServiceUtil.java