Print more informantion about cached Docker images linux (#1906)

* Add docker full info

* make tabular output

* fix shebang

* remove created at time

Co-authored-by: Sergey Dolin <v-sedoli@micorosoft.com>
This commit is contained in:
Sergey Dolin
2020-11-05 14:20:40 +05:00
committed by GitHub
parent 371d0f96d5
commit ff49068542
2 changed files with 14 additions and 2 deletions

View File

@@ -240,6 +240,17 @@ function Get-CachedDockerImages {
return $images
}
function Get-CachedDockerImagesTableData {
return (sudo docker images --digests --format "*{{.Repository}}:{{.Tag}}|{{.Digest}} |{{.CreatedAt}}").Split("*") | Where-Object { $_ } | ForEach-Object {
$parts=$_.Split("|")
[PSCustomObject] @{
"Repository:Tag" = $parts[0]
"Digest" = $parts[1]
"Created" = $parts[2].split(' ')[0]
}
}
}
function Get-AptPackages {
$toolsetJson = Get-ToolsetContent
$apt = $toolsetJson.apt
@@ -252,4 +263,4 @@ function Get-PipxVersion {
$result -match "(?<version>\d+\.\d+\.\d+\.?\d*)" | Out-Null
$pipxVersion = $Matches.Version
return "Pipx $pipxVersion"
}
}

View File

@@ -224,7 +224,8 @@ $markdown += Build-AndroidTable | New-MDTable
$markdown += New-MDNewLine
$markdown += New-MDHeader "Cached Docker images" -Level 3
$markdown += New-MDList -Style Unordered -Lines @(Get-CachedDockerImages)
$markdown += Get-CachedDockerImagesTableData | New-MDTable
$markdown += New-MDNewLine
$markdown += New-MDHeader "Installed apt packages" -Level 3
$markdown += New-MDList -Style Unordered -Lines @(Get-AptPackages)