Skip to content

Qemu in Github Action Workflow with arm64 platform #69

Open
@1fini

Description

@1fini

Behaviour

[linux/arm64 publish 1/1] RUN dotnet publish "Automate.csproj" -c Release -o /app/publish:

/usr/share/dotnet/sdk/7.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(201,5): error MSB4063: The "CheckForDuplicateItems" task could not be initialized with its input parameters. [/src/Automate/Automate.csproj]

Steps to reproduce this issue

  1. Dockerfile with net7 app
  2. Qemu to build image for platform arm64 on GitHub Actions
name: Docker Image CI

on:
  push:
    branches: [ main ]
    tags:
      - 'v*'

jobs:

  build:

    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Login to DockerHub
      uses: docker/login-action@v1
      with:
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKERHUB_PASSWORD }}
        
    - name: Set up QEMU
      uses: docker/setup-qemu-action@v2
      with:
        platforms: all
        
    - name: Set up Docker Buildx
      id: docker_buildx
      uses: docker/setup-buildx-action@v1
        
    - name: Build and push amd64 & arm64
      uses: docker/build-push-action@v2
      with:
        builder: ${{ steps.docker_buildx.outputs.name}}
        context: .
        file: ./Automate/Dockerfile
        push: true
        platforms: linux/amd64, linux/arm64
        tags: ${{ steps.meta.outputs.tags }}
        labels: ${{ steps.meta.outputs.labels }}

Dockerfile

FROM mcr.microsoft.com/dotnet/runtime:7.0-jammy AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:7.0-jammy AS build
WORKDIR /src
COPY ["Automate/Automate.csproj", "Automate/"]
COPY ["Automate.Domain/Automate.Domain.csproj", "Automate.Domain/"]
COPY ["Automate.Infrastructure/Automate.Infrastructure.csproj", "Automate.Infrastructure/"]
RUN dotnet restore "Automate/Automate.csproj"
COPY . .
WORKDIR "/src/Automate"
RUN dotnet build "Automate.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Automate.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Automate.dll"]

Logs

first paragraph

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions