code: func (cli *DockerCli) RegistryClient(allowInsecure bool) registryclient.RegistryClient {
  	resolver := func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig {
  		return ResolveAuthConfig(ctx, cli, index)
  	}
  	return registryclient.NewRegistryClient(resolver, UserAgent(), allowInsecure)
  }
docs: // RegistryClient returns a client for communicating with a Docker distribution
  // registry