@Override
  public BuildResult call() throws InterruptedException, IOException {
    EventHandlers eventHandlers = buildContext.getEventHandlers();
    try (TimerEventDispatcher ignored =
        new TimerEventDispatcher(eventHandlers, "Loading to Docker daemon")) {
      eventHandlers.dispatch(LogEvent.progress("Loading to Docker daemon..."));
      ImageTarball imageTarball =
          new ImageTarball(
              builtImage,
              buildContext.getTargetImageConfiguration().getImage(),
              buildContext.getAllTargetImageTags());

      // Note: The progress reported here is not entirely accurate. The total allocation units is
      // the size of the layers, but the progress being reported includes the config and manifest
      // as well, so we will always go over the total progress allocation here.
      // See https://github.com/GoogleContainerTools/jib/pull/1960#discussion_r321898390
      try (ProgressEventDispatcher progressEventDispatcher =
              progressEventDispatcherFactory.create(
                  "loading to Docker daemon", imageTarball.getTotalLayerSize());
          ThrottledAccumulatingConsumer throttledProgressReporter =
              new ThrottledAccumulatingConsumer(progressEventDispatcher::dispatchProgress)) {
        // Load the image to docker daemon.
        eventHandlers.dispatch(
            LogEvent.debug(dockerClient.load(imageTarball, throttledProgressReporter)));

        return BuildResult.fromImage(builtImage, buildContext.getTargetFormat());
      }
    }
  }
Adds image layers to a tarball and loads into Docker daemon.
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/LoadDockerStep.java