Skip to content

Not able to build multiple Dockerfiles to create a multi-arch image #2840

@alanraju-aot

Description

@alanraju-aot

We have a problem to build one of our containers that have two Dockerfiles. One is for normal amd64 and and another one used for arm64. So our condition is to build those two docker files using a Git action to build and push a multi-arch image that can both be used in mac and windows. I have tried some solutions like follows:

    • name: Build and Push Multi-Arch Image
      run: |
      docker buildx build
      --platform linux/amd64,linux/arm64
      --file Dockerfile --file Dockerfile-ARM64
      --tag repo-name/image-name:{tag}
      --push .
    • name: Build and push Docker image
      if: ${{ github.ref == 'refs/heads/master' }}
      uses: docker/build-push-action@v4
      with:
      context: container-name
      file: |
      container-name/Dockerfile
      container-name/Dockerfile-ARM64
      push: true
      platforms: linux/amd64,linux/arm64/v8
      tags: ${{ steps.meta.outputs.tags }}, repo-name/image-name:{tag}
      labels: ${{ steps.meta.outputs.labels }}

whenever we run the workflow I'm getting the error as :
`` Run docker buildx build
#0 building with "builder-7d387e50-81ba-4f37-b2a8-6b4d790c3f09" instance using docker-container driver

#1 [internal] load build definition from Dockerfile-ARM64
#1 transferring dockerfile: 2B done
#1 DONE 0.0s
ERROR: failed to solve: failed to read dockerfile: open Dockerfile-ARM64: no such file or directory
Error: Process completed with exit code 1. ``

But the path is absolute correct. Can anyone help with this issue?

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