private void obtainBaseImagesLayers(
      boolean layersRequiredLocally, ProgressEventDispatcher.Factory progressDispatcherFactory) {
    results.baseImagesAndLayers =
        executorService.submit(
            () -> {
              try (ProgressEventDispatcher progressDispatcher =
                  progressDispatcherFactory.create(
                      "scheduling obtaining base images layers",
                      results.baseImagesAndRegistryClient.get().images.size())) {

                Map<DescriptorDigest, Future<PreparedLayer>> preparedLayersCache = new HashMap<>();
                Map<Image, List<Future<PreparedLayer>>> baseImagesAndLayers = new LinkedHashMap<>();
                for (Image baseImage : results.baseImagesAndRegistryClient.get().images) {
                  List<Future<PreparedLayer>> layers =
                      obtainBaseImageLayers(
                          baseImage,
                          layersRequiredLocally,
                          preparedLayersCache,
                          progressDispatcher.newChildProducer());
                  baseImagesAndLayers.put(baseImage, layers);
                }
                return baseImagesAndLayers;
              }
            });
  }
Run all steps and return a BuildResult after a build is completed.

@return a {@link BuildResult} with build metadata
@throws ExecutionException if an error occurred during asynchronous execution of steps
@throws InterruptedException if the build was interrupted while waiting for results
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java