Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Query a docker registry v2/_catalog endpoint from powershell
#TODO: handle https & no basic auth as well..
$RegistryEndpoint = "",
$UserName = "user",
$Password = "password"
#encode credentials to Base64String
$AuthString = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$($UserName):$($Password)"))
$Result = (Invoke-RestMethod -Uri "http://$RegistryEndpoint/v2/_catalog" -Method Get -Headers @{ Authorization = "Basic $AuthString";}).repositories -Match $Filter
Write-Host -ForegroundColor Green ("found {0} images:" -f $Result.count)
$Result | % {
(irm -uri "http://$RegistryEndpoint/v2/$image/tags/list" -Method Get -Headers @{ Authorization = "Basic $AuthString";}).tags | % {
" docker pull $RegistryEndpoint/${image}:${tag}"

This comment has been minimized.

Copy link
Owner Author

@so0k so0k commented Jul 29, 2015

Sample usage from powershell commandline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment