Skip to content

Available platforms has more than required platforms #57

Open
@anuj-scanova

Description

@anuj-scanova

Using in the Github actions using the following template

  build:
    name: Build Image
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
        with:
          image: tonistiigi/binfmt:latest
          platforms: arm64,arm

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      - 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: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
          aws-region: ${{ env.AWS_REGION }}

      - name: Login to Amazon ECR
        id: login-ecr
        uses: aws-actions/amazon-ecr-login@v1

      - name: Get Tags for Image
        id: metadata
        uses: docker/metadata-action@v3
        with:
          images: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}
          tags: |
            type=raw,value=latest
            type=raw,value=${{ github.event.release.tag_name }}
            type=sha

      - name: Docker build/tag/push
        uses: docker/build-push-action@v2
        with:
          context: .
          platforms: linux/arm64
          push: true
          tags: ${{ steps.metadata.outputs.tags }}

Where I want want to build the docker image against arm64 architecture and not others.
But the execution of the above workflow runs build for all platforms, taking a long time to build (approx 30 minutes) which for a single platform completes in 4-5 minutes.

Screen Shot 2022-06-29 at 10 23 53 AM

The provided value is arm64 which the available platforms are linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions