static Optional<Credential> getTargetImageCredential(BuildContext buildContext)
      throws CredentialRetrievalException {
    return retrieve(buildContext.getTargetImageConfiguration(), buildContext.getEventHandlers());
  }
Retrieves credentials for the target image.
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/RegistryCredentialRetriever.java