code: public static String firstRegistryOf(String ... checkFirst) {
          for (String registry : checkFirst) {
              if (registry != null) {
                  return registry;
              }
          }
          // Check environment as last resort
          return System.getenv("DOCKER_REGISTRY");
      }
docs: Return the first non null registry given. Use the env var DOCKER_REGISTRY as final fallback
  @param checkFirst list of registries to check
  @return registry found or null if none.