I managed to get somewhat what I needed from the native api.
I wrote this script which displays the sum of each image layers, grouped by package
$key = "<key with native api access>"
$uribase="http://<proget server>/api/json/"
$feedid = <feed id>
$packages = Invoke-webrequest "$($uribase)DockerImages_GetRepositories?key=$($key)&Feed_ID=$feedid" | select -expandproperty Content | convertfrom-json
$size_lookup = @{}
$data = @()
$total = $packages.length
$count = 0;
$packages | %{
$n = [uri]::EscapeDataString($_.Repository_Name)
$progressPreference = 'silentlyContinue'
$images = Invoke-webrequest "$($uribase)DockerImages_GetImages?key=$($key)&Feed_ID=$($feedid)&Repository_name=$n" | select -expandproperty Content | convertfrom-json
$progressPreference = 'Continue'
$images | %{
$manifest = [System.Text.Encoding]::UTF8.GetString( [Convert]::FromBase64String($_.ManifestJson_Bytes) ) | convertfrom-json
$layers = $manifest.layers
$sizesum = $layers | ?{$_.size -ne $null } | measure -sum size | select -ExpandProperty sum
$obj = @{}
$obj.Add("Feed",$_.feed_id)
$obj.Add("Repository",$_.Repository_name)
$obj.Add("Manifest",$manifest )
$obj.Add("Layersum", $sizesum )
$obj.Add("DownloadCount",$_.Download_Count)
$obj.Add("Published",$_.Published_Date)
$data += $obj
}
$count++
write-progress -PercentComplete ($count*100/$total) -Activity "Working..."
}
$data | convertto-json -depth 99 | set-content -encoding utf8 out.json
$data | group-object Repository | %{
$s=$_.group | measure -sum layersum | select -ExpandProperty sum;
$n = $_.name;
new-object psobject -Property @{"name"=$n;"size"=$s}
} | sort-object size