Skip to content

Commit

Permalink
Merge pull request #229 from WyriHaximusNet/intermediate-tag-to-not-h…
Browse files Browse the repository at this point in the history
…ave-to-push-images-for-manifest

Intermediate tag to not have to push images for manifest
  • Loading branch information
WyriHaximus authored Oct 13, 2023
2 parents c3862ac + a84f3b8 commit 7b9ad4f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,20 @@ jobs:
exclude: ${{ fromJson(needs.exclude-matrix.outputs.exclude) }}
steps:
- uses: actions/checkout@v3
- uses: dbhi/qus/action@main
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Download Images
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -296,6 +309,7 @@ jobs:
max_attempts: 5
command: |
(jq -r 'to_entries | map("(find ./docker-image/ | grep image.tags | xargs -I $ cat $) | xargs -I % docker tag % " + .key + "/%") | .[]' <<<"$DOCKER_IMAGE_REGISTRIES_SECRET_MAPPING") | sh
(jq -r 'to_entries | map("(find ./docker-image/ | grep image.tags | xargs -I $ cat $) | xargs -I % docker push " + .key + "/%") | .[]' <<<"$DOCKER_IMAGE_REGISTRIES_SECRET_MAPPING") | sh
- run: docker images
- name: Push all images to registries
uses: nick-invision/retry@v2
Expand Down
8 changes: 3 additions & 5 deletions utils/create-manifest-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
file('tags-to-push.list')
)
) as $image) {
file_put_contents('./command.sh', "\ndocker manifest create \"" . $argv[1] . "/" . trim($image) . "\"", \FILE_APPEND);
$dockerFilename = 'docker-file-' . md5($argv[1] . "/" . trim($image));
file_put_contents($dockerFilename, 'FROM ' . $argv[1] . "/" . trim($image) . '-${TARGETARCH}');

foreach ($archs as $arch) {
file_put_contents('./command.sh', " --amend " . $argv[1] . "/" . trim($image) . "-" . $arch, \FILE_APPEND);
}
file_put_contents('./command.sh', "\ndocker manifest push \"" . $argv[1] . "/" . trim($image) . "\"\n", \FILE_APPEND);
file_put_contents('./command.sh', "\ndocker buildx build -f " . $dockerFilename . " --platform=linux/" . implode(",linux/", $archs) . " -t \"" . $argv[1] . "/" . trim($image) . "\" --push .\n", \FILE_APPEND);
}

file_put_contents(
Expand Down

0 comments on commit 7b9ad4f

Please sign in to comment.