Skip to content

Commit

Permalink
use output=type=docker
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Aug 17, 2023
1 parent 5b53973 commit 7a1f551
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ runs:
--cache-from "${repo}:${{ inputs.tag }}" \
--image-name "${repo}:${{ inputs.tag }}" \
--workspace-folder "$(realpath -m ./image)" \
--output "type=oci,dest=${{ runner.temp }}/${{ inputs.arch }}.tar" \
--output "type=docker,dest=${{ runner.temp }}/${{ inputs.arch }}.tar" \
;
14 changes: 7 additions & 7 deletions .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
with:
persist-credentials: false

name: Free up disk space
- name: Free up disk space
uses: ./.github/actions/free-disk-space
with:
tool_cache: "${{ runner.tool_cache }}"
Expand Down Expand Up @@ -95,12 +95,12 @@ jobs:
hashes=();
for arch in "amd64" "arm64"; do
# Load the linux/$arch image with the final name
docker import --platform "linux/${arch}" "${{ runner.temp }}/${arch}.tar" ${name};
# Push the local image to the registry to get its remote hash
hash="$(docker push ${name} | tail -n1 | cut -d' ' -f3)";
# Save the remote hash for use below
hashes+=("$hash");
# Load the linux/$arch and tag the loaded image with the final name
docker image tag \
$(docker load --input "${{ runner.temp }}/${arch}.tar" | tail -n1 | cut -d' ' -f3) \
${name};
# Push the local image to the registry to get its remote hash and save the remote hash for use below
hashes+=("$(docker push ${name} | tail -n1 | cut -d' ' -f3)");
done
# Create and push the multiarch manifest
Expand Down

0 comments on commit 7a1f551

Please sign in to comment.