public RegistryClient.Factory newTargetImageRegistryClientFactory() {
    // if base and target are on the same registry, try enabling cross-repository mounts
    if (baseImageConfiguration
        .getImageRegistry()
        .equals(targetImageConfiguration.getImageRegistry())) {
      return RegistryClient.factory(
              getEventHandlers(),
              targetImageConfiguration.getImageRegistry(),
              targetImageConfiguration.getImageRepository(),
              baseImageConfiguration.getImageRepository(),
              httpClient)
          .setUserAgent(makeUserAgent());
    }
    return RegistryClient.factory(
            getEventHandlers(),
            targetImageConfiguration.getImageRegistry(),
            targetImageConfiguration.getImageRepository(),
            httpClient)
        .setUserAgent(makeUserAgent());
  }
Creates a new {@link com.google.cloud.tools.jib.registry.RegistryClient.Factory} for the target
image with fields from the build configuration.

@return a new {@link com.google.cloud.tools.jib.registry.RegistryClient.Factory}
jib-core/src/main/java/com/google/cloud/tools/jib/configuration/BuildContext.java