private void addRetrievalSteps(boolean layersRequiredLocally) {
    ImageConfiguration baseImageConfiguration = buildContext.getBaseImageConfiguration();

    if (baseImageConfiguration.getTarPath().isPresent()) {
      // If tarPath is present, a TarImage was used
      stepsToRun.add(this::extractTar);

    } else if (baseImageConfiguration.getDockerClient().isPresent()) {
      // If dockerClient is present, a DockerDaemonImage was used
      stepsToRun.add(this::saveDocker);

    } else {
      // Otherwise default to RegistryImage
      stepsToRun.add(this::pullBaseImages);
      stepsToRun.add(
          progressDispatcherFactory ->
              obtainBaseImagesLayers(layersRequiredLocally, progressDispatcherFactory));
    }
  }
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