Skip to content

Commit

Permalink
Try regctl
Browse files Browse the repository at this point in the history
  • Loading branch information
sixeyed committed Jan 6, 2025
1 parent df2bef7 commit 9c35835
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,12 @@ jobs:
- chapters-windows-ltsc2025
runs-on: ubuntu-latest
steps:
- name: Registry login
uses: docker/login-action@v3
- uses: regclient/actions/regctl-installer@main
- uses: regclient/actions/regctl-login@main
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
Expand Down
18 changes: 14 additions & 4 deletions build/push-manifests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ param(
[string]$Filter=$null,
[switch]$Images=$true,
[switch]$Chapters=$false,
[switch]$UseRegctl=$true,
[switch]$Delete=$false,
[switch]$Pull=$false
)

Expand Down Expand Up @@ -49,20 +51,28 @@ try {
$variantList = @()
foreach ($variant in $variants) {
$ref = "$($image)-$variant"
$manifest = docker manifest inspect $ref | ConvertFrom-Json
if ($UseRegctl) {
$manifest = regctl manifest get $ref --format raw-body | ConvertFrom-Json
}
else {
$manifest = docker manifest inspect $ref | ConvertFrom-Json
}
if ($null -ne $manifest -and $manifest.mediaType -eq $manifestMediaType) {
$variantList += $ref
echo "** Image variant found. Will add to manifest list: $ref"
}
else {
echo "** Image variant found. Skipping: $ref"
echo "** Image variant NOT found. Skipping: $ref"
}
}

docker manifest rm $image
if ($Delete) {
docker manifest rm $image
}

docker manifest create --amend $image @variantList
docker manifest push $image

if ($Pull) {
docker pull $image
}
Expand Down

0 comments on commit 9c35835

Please sign in to comment.