Skip to content

Commit

Permalink
Update .github/workflows/docker-buildx.yaml
Browse files Browse the repository at this point in the history
Remove `manifest_from_image` logic, since this is not needed anymore.

Signed-off-by: Ionut Balutoiu <ibalutoiu@cloudbasesolutions.com>
  • Loading branch information
ionutbalutoiu committed Dec 5, 2023
1 parent 9bf268e commit 437f3bd
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/docker-buildx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ on:
required: false
type: string

manifest_from_image:
required: false
type: string

jobs:
docker-buildx:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -61,26 +57,3 @@ jobs:
build-args: ${{ inputs.build_args }}
pull: true
push: ${{ github.event_name != 'pull_request' }}

- name: Copy image manifest
if: github.event_name != 'pull_request' && inputs.manifest_from_image != ''
shell: bash
run: |
set -e
set -o pipefail
IMAGE=ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }}:${{ steps.meta.outputs.version }}
MANIFEST_MEDIA_TYPE=$(docker buildx imagetools inspect --raw $IMAGE | jq -r '.mediaType')
if [[ $MANIFEST_MEDIA_TYPE != "application/vnd.docker.distribution.manifest.list.v2+json" ]]; then
echo "Image manifest is not a manifest list. Skipping manifest copy."
exit 0
fi
MANIFEST_FROM_IMAGE=${{ inputs.manifest_from_image }}
PLATFORM=$(docker buildx imagetools inspect --raw $MANIFEST_FROM_IMAGE | jq -cr '.manifests[] | select(.platform.os=="windows") | .platform')
ARCH=$(echo $PLATFORM | jq -r ".architecture")
OS_VERSION=$(echo $PLATFORM | jq -r '."os.version"')
docker buildx imagetools inspect --raw $IMAGE | jq ".manifests[] | select(.platform.os==\"windows\") | .platform.\"os.version\"=\"${OS_VERSION}\" | .platform.architecture=\"${ARCH}\"" > manifest.json
docker buildx imagetools create -f manifest.json -t $IMAGE

0 comments on commit 437f3bd

Please sign in to comment.