private List<Image> pullPublicImages(
      RegistryClient registryClient, ProgressEventDispatcher progressDispatcher)
      throws IOException, RegistryException, LayerCountMismatchException,
          BadContainerConfigurationFormatException {
    try {
      // First, try with no credentials. This works with public GCR images.
      return pullBaseImages(registryClient, progressDispatcher.newChildProducer());

    } catch (RegistryUnauthorizedException ex) {
      // in case if a registry requires bearer auth
      registryClient.doPullBearerAuth();
      return pullBaseImages(registryClient, progressDispatcher.newChildProducer());
    }
  }
Structure for the result returned by this step.
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/PullBaseImageStep.java