mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 12:48:18 +00:00
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:
@@ -240,6 +240,17 @@ function Get-CachedDockerImages {
|
|||||||
return $images
|
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 {
|
function Get-AptPackages {
|
||||||
$toolsetJson = Get-ToolsetContent
|
$toolsetJson = Get-ToolsetContent
|
||||||
$apt = $toolsetJson.apt
|
$apt = $toolsetJson.apt
|
||||||
@@ -252,4 +263,4 @@ function Get-PipxVersion {
|
|||||||
$result -match "(?<version>\d+\.\d+\.\d+\.?\d*)" | Out-Null
|
$result -match "(?<version>\d+\.\d+\.\d+\.?\d*)" | Out-Null
|
||||||
$pipxVersion = $Matches.Version
|
$pipxVersion = $Matches.Version
|
||||||
return "Pipx $pipxVersion"
|
return "Pipx $pipxVersion"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,7 +224,8 @@ $markdown += Build-AndroidTable | New-MDTable
|
|||||||
$markdown += New-MDNewLine
|
$markdown += New-MDNewLine
|
||||||
|
|
||||||
$markdown += New-MDHeader "Cached Docker images" -Level 3
|
$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-MDHeader "Installed apt packages" -Level 3
|
||||||
$markdown += New-MDList -Style Unordered -Lines @(Get-AptPackages)
|
$markdown += New-MDList -Style Unordered -Lines @(Get-AptPackages)
|
||||||
|
|||||||
Reference in New Issue
Block a user