@VisibleForTesting
  Image fetchBuiltImageForLocalBuild(
      String osType, String architecture, EventHandlers eventHandlers)
      throws InterruptedException, ExecutionException {
    if (results.baseImagesAndBuiltImages.get().size() > 1) {
      eventHandlers.dispatch(
          LogEvent.warn(
              String.format(
                  "Detected multi-platform configuration, only building image that matches the local Docker Engine's os and architecture (%s/%s) or "
                      + "the first platform specified",
                  osType, architecture)));
      for (Map.Entry<Image, Future<Image>> imageEntry :
          results.baseImagesAndBuiltImages.get().entrySet()) {
        Image image = imageEntry.getValue().get();
        if (image.getArchitecture().equals(architecture) && image.getOs().equals(osType)) {
          return image;
        }
      }
    }
    return results.baseImagesAndBuiltImages.get().values().iterator().next().get();
  }
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