.NET (C#) Client Library for interacting with a Docker Registry API (v2 only).
Install nuget package into your project via powershell:
PM> Install-Package Docker.Registry.DotNet
Add nuget package via dotnet CLI:
dotnet add package Docker.Registry.DotNet
var configuration = new RegistryClientConfiguration("http://localhost:5000");
//configuration.UsePasswordOAuthAuthentication("username", "password")
using (var client = configuration.CreateClient())
{
// get catalog
var catalog = await client.Catalog.GetCatalog();
// list tags for the first catalog
var tags = await client.Tags.ListTags(catalog?.Repositories.FirstOrDefault());
}
var configuration = new RegistryClientConfiguration("https://proget.mycompany.com");
configuration.UsePasswordOAuthAuthentication("username", "password");
using (var client = configuration.CreateClient())
{
// get catalog
var catalog = await client.Catalog.GetCatalog();
// list tags for the first catalog
var tags = await client.Tags.ListTags(catalog?.Repositories.FirstOrDefault());
}
var configuration = new RegistryClientConfiguration("https://hub.docker.com");
using (var client = configuration.CreateClient())
{
// load respository
var tags = await client.Repository.ListRepositoryTags("grafana", "loki-docker-driver");
}