static ObtainBaseImageLayerStep forSelectiveDownload(
      BuildContext buildContext,
      ProgressEventDispatcher.Factory progressEventDispatcherFactory,
      Layer layer,
      @Nullable RegistryClient sourceRegistryClient,
      RegistryClient targetRegistryClient) {
    Verify.verify(!buildContext.isOffline());

    // TODO: also check if cross-repo blob mount is possible.
    BlobExistenceChecker blobExistenceChecker =
        digest ->
            targetRegistryClient.checkBlob(digest).isPresent()
                ? StateInTarget.EXISTING
                : StateInTarget.MISSING;

    return new ObtainBaseImageLayerStep(
        buildContext,
        progressEventDispatcherFactory,
        layer,
        sourceRegistryClient,
        blobExistenceChecker);
  }
Pulls and caches a single base image layer.
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/ObtainBaseImageLayerStep.java