'Docker build multiplatform asp.net core 5.0 app on armV7 with github action

I have a problem and I can't find a solution... I try to build docker image in a pipline with docker actions. My docker image build an ASP.NET core 5.0 app.

All my scripts (dockerfile and my github workflow file) works fine, and I build my image with success. However, when I try to build my image on multi architectures including linux/arm/v7, I have an error. NOTE: On other architectures like linux/amd64 or linux/arm64, it works fine.

My error from my logs:

error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c dotnet restore "APITemperature/APITemperature.csproj"]: exit code: 131

Here are my files and logs:

  • Github action workflow file:
name: .NET

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  Docker:
    runs-on: ubuntu-20.04
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - 
        name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildx-
      -
        name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      -
        name: Build and push
        uses: docker/build-push-action@v2
        with:
          context: .
          builder: ${{ steps.buildx.outputs.name }}
          platforms: linux/arm/v7
          file: ./APITemperature/Dockerfile
          push: true
          tags: ${{ secrets.DOCKERHUB_USERNAME }}/apitemperature:latest
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache
  • Dockerfile:
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 5000
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["APITemperature/APITemperature.csproj", "APITemperature/"]
RUN dotnet restore "APITemperature/APITemperature.csproj"
COPY . .
WORKDIR "/src/APITemperature"
RUN dotnet build "APITemperature.csproj" -c Release -o /app/build

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

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "APITemperature.dll"]
  • My pipeline job logs (with my error):

2021-04-20T14:45:05.9456541Z [command]/usr/bin/git log -1 --format='%H'
2021-04-20T14:45:05.9488487Z '15dffc581efbfb4879571675bdafcd652c5e3817'
2021-04-20T14:45:05.9685714Z ##[group]Run docker/setup-qemu-action@v1
2021-04-20T14:45:05.9686283Z with:
2021-04-20T14:45:05.9686746Z   image: tonistiigi/binfmt:latest
2021-04-20T14:45:05.9687272Z   platforms: all
2021-04-20T14:45:05.9687702Z ##[endgroup]
2021-04-20T14:45:06.0090840Z ##[group]Pulling binfmt Docker image
2021-04-20T14:45:06.0156093Z [command]/usr/bin/docker pull tonistiigi/binfmt:latest
2021-04-20T14:45:06.6146472Z latest: Pulling from tonistiigi/binfmt
2021-04-20T14:45:06.6841596Z b2cca52c34c9: Pulling fs layer
2021-04-20T14:45:06.6842223Z 6247d1dfaecd: Pulling fs layer
2021-04-20T14:45:06.9020179Z 6247d1dfaecd: Verifying Checksum
2021-04-20T14:45:06.9020848Z 6247d1dfaecd: Download complete
2021-04-20T14:45:06.9328963Z b2cca52c34c9: Verifying Checksum
2021-04-20T14:45:06.9329606Z b2cca52c34c9: Download complete
2021-04-20T14:45:07.3101592Z b2cca52c34c9: Pull complete
2021-04-20T14:45:07.4273645Z 6247d1dfaecd: Pull complete
2021-04-20T14:45:07.4347064Z Digest: sha256:c94a8dab5c7d9913687e77f529fc2a487dcb6aaea2f040e588cfebd778ebcb1a
2021-04-20T14:45:07.4425996Z Status: Downloaded newer image for tonistiigi/binfmt:latest
2021-04-20T14:45:07.4427120Z docker.io/tonistiigi/binfmt:latest
2021-04-20T14:45:07.4476348Z ##[endgroup]
2021-04-20T14:45:07.4477209Z ##[group]Installing QEMU static binaries
2021-04-20T14:45:07.4478809Z [command]/usr/bin/docker run --rm --privileged tonistiigi/binfmt:latest --install all
2021-04-20T14:45:08.4432706Z 2021/04/20 14:45:08 installing: riscv64 OK
2021-04-20T14:45:08.4433411Z 2021/04/20 14:45:08 installing: ppc64le OK
2021-04-20T14:45:08.4434205Z 2021/04/20 14:45:08 installing: mips64el OK
2021-04-20T14:45:08.4434883Z 2021/04/20 14:45:08 installing: mips64 OK
2021-04-20T14:45:08.4435495Z 2021/04/20 14:45:08 installing: arm64 OK
2021-04-20T14:45:08.4466628Z 2021/04/20 14:45:08 installing: arm OK
2021-04-20T14:45:08.4467265Z 2021/04/20 14:45:08 installing: s390x OK
2021-04-20T14:45:08.4467725Z {
2021-04-20T14:45:08.4468262Z   "supported": [
2021-04-20T14:45:08.4468835Z     "linux/amd64",
2021-04-20T14:45:08.4469277Z     "linux/arm64",
2021-04-20T14:45:08.4469788Z     "linux/riscv64",
2021-04-20T14:45:08.4470263Z     "linux/ppc64le",
2021-04-20T14:45:08.4470803Z     "linux/s390x",
2021-04-20T14:45:08.4471733Z     "linux/386",
2021-04-20T14:45:08.4472247Z     "linux/mips64le",
2021-04-20T14:45:08.4472778Z     "linux/mips64",
2021-04-20T14:45:08.4473223Z     "linux/arm/v7",
2021-04-20T14:45:08.4473763Z     "linux/arm/v6"
2021-04-20T14:45:08.4475213Z   ],
2021-04-20T14:45:08.4475700Z   "emulators": [
2021-04-20T14:45:08.4476126Z     "cli",
2021-04-20T14:45:08.4477262Z     "llvm-10-runtime.binfmt",
2021-04-20T14:45:08.4478207Z     "llvm-11-runtime.binfmt",
2021-04-20T14:45:08.4479011Z     "llvm-9-runtime.binfmt",
2021-04-20T14:45:08.4479628Z     "python2.7",
2021-04-20T14:45:08.4480080Z     "python3.8",
2021-04-20T14:45:08.4480743Z     "qemu-aarch64",
2021-04-20T14:45:08.4481356Z     "qemu-arm",
2021-04-20T14:45:08.4482035Z     "qemu-mips64",
2021-04-20T14:45:08.4482743Z     "qemu-mips64el",
2021-04-20T14:45:08.4483395Z     "qemu-ppc64le",
2021-04-20T14:45:08.4484100Z     "qemu-riscv64",
2021-04-20T14:45:08.4484712Z     "qemu-s390x"
2021-04-20T14:45:08.4485196Z   ]
2021-04-20T14:45:08.4485744Z }
2021-04-20T14:45:08.5113338Z ##[endgroup]
2021-04-20T14:45:08.5114359Z ##[group]Extracting available platforms
2021-04-20T14:45:09.0506708Z linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
2021-04-20T14:45:09.0528723Z ##[endgroup]
2021-04-20T14:45:09.0732277Z ##[group]Run docker/setup-buildx-action@v1
2021-04-20T14:45:09.0732899Z with:
2021-04-20T14:45:09.0733459Z   driver: docker-container
2021-04-20T14:45:09.0734757Z   buildkitd-flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
2021-04-20T14:45:09.0735981Z   install: false
2021-04-20T14:45:09.0736470Z   use: true
2021-04-20T14:45:09.0736898Z ##[endgroup]
2021-04-20T14:45:09.4913411Z Using buildx 0.5.1
2021-04-20T14:45:09.4916188Z ##[group]Creating a new builder instance
2021-04-20T14:45:09.4938305Z [command]/usr/bin/docker buildx create --name builder-c0cc5836-daba-4418-aa07-003804840d19 --driver docker-container --buildkitd-flags --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host --use
2021-04-20T14:45:09.5860625Z builder-c0cc5836-daba-4418-aa07-003804840d19
2021-04-20T14:45:09.5895737Z ##[endgroup]
2021-04-20T14:45:09.5897247Z ##[group]Booting builder
2021-04-20T14:45:09.5917970Z [command]/usr/bin/docker buildx inspect --bootstrap --builder builder-c0cc5836-daba-4418-aa07-003804840d19
2021-04-20T14:45:09.6752614Z #1 [internal] booting buildkit
2021-04-20T14:45:09.6754735Z #1 sha256:b81dbef062f5e95badead70b79b505149332f554041cc344fa344e1d32563422
2021-04-20T14:45:09.8263703Z #1 pulling image moby/buildkit:buildx-stable-1
2021-04-20T14:45:12.0788111Z #1 pulling image moby/buildkit:buildx-stable-1 2.3s done
2021-04-20T14:45:12.0789582Z #1 creating container buildx_buildkit_builder-c0cc5836-daba-4418-aa07-003804840d190
2021-04-20T14:45:13.1832060Z #1 creating container buildx_buildkit_builder-c0cc5836-daba-4418-aa07-003804840d190 1.2s done
2021-04-20T14:45:13.1833134Z #1 DONE 3.5s
2021-04-20T14:45:13.3455841Z Name:   builder-c0cc5836-daba-4418-aa07-003804840d19
2021-04-20T14:45:13.3457016Z Driver: docker-container
2021-04-20T14:45:13.3457390Z 
2021-04-20T14:45:13.3457733Z Nodes:
2021-04-20T14:45:13.3459156Z Name:      builder-c0cc5836-daba-4418-aa07-003804840d190
2021-04-20T14:45:13.3460106Z Endpoint:  unix:///var/run/docker.sock
2021-04-20T14:45:13.3460648Z Status:    running
2021-04-20T14:45:13.3462010Z Flags:     --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
2021-04-20T14:45:13.3463408Z Platforms: linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
2021-04-20T14:45:13.3464666Z ##[endgroup]
2021-04-20T14:45:13.3465308Z ##[group]Extracting available platforms
2021-04-20T14:45:13.5601180Z linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
2021-04-20T14:45:13.5642286Z ##[endgroup]
2021-04-20T14:45:13.5934211Z ##[group]Run actions/cache@v2
2021-04-20T14:45:13.5934690Z with:
2021-04-20T14:45:13.5935146Z   path: /tmp/.buildx-cache
2021-04-20T14:45:13.5936199Z   key: Linux-buildx-15dffc581efbfb4879571675bdafcd652c5e3817
2021-04-20T14:45:13.5937315Z   restore-keys: Linux-buildx-

2021-04-20T14:45:13.5937860Z ##[endgroup]
2021-04-20T14:45:14.9967489Z Received 159383552 of 176752324 (90.2%), 152.0 MBs/sec
2021-04-20T14:45:15.3871940Z Received 176752324 of 176752324 (100.0%), 121.3 MBs/sec
2021-04-20T14:45:15.3878375Z Cache Size: ~169 MB (176752324 B)
2021-04-20T14:45:15.3917790Z [command]/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/a6d0db92-9c04-4dcc-a5d6-0fec23d64dee/cache.tzst -P -C /home/runner/work/HomeAutomation/HomeAutomation
2021-04-20T14:45:15.6656176Z Cache restored successfully
2021-04-20T14:45:15.6961100Z Cache restored from key: Linux-buildx-3b667c4f1df151892c74b971af8c08cd80d9c23f
2021-04-20T14:45:15.7240763Z ##[group]Run docker/login-action@v1
2021-04-20T14:45:15.7241326Z with:
2021-04-20T14:45:15.7242356Z   username: ***
2021-04-20T14:45:15.7243148Z   password: ***
2021-04-20T14:45:15.7243584Z   logout: true
2021-04-20T14:45:15.7244514Z ##[endgroup]
2021-04-20T14:45:15.7729702Z 🔑 Logging into Docker Hub...
2021-04-20T14:45:15.9554423Z 🎉 Login Succeeded!
2021-04-20T14:45:15.9696153Z ##[group]Run docker/build-push-action@v2
2021-04-20T14:45:15.9696817Z with:
2021-04-20T14:45:15.9697540Z   context: .
2021-04-20T14:45:15.9697960Z   platforms: linux/arm/v7
2021-04-20T14:45:15.9698523Z   file: ./APITemperature/Dockerfile
2021-04-20T14:45:15.9699036Z   push: true
2021-04-20T14:45:15.9699648Z   tags: ***/apitemperature:latest
2021-04-20T14:45:15.9700276Z   cache-from: type=local,src=/tmp/.buildx-cache
2021-04-20T14:45:15.9700963Z   cache-to: type=local,dest=/tmp/.buildx-cache
2021-04-20T14:45:15.9701501Z   load: false
2021-04-20T14:45:15.9701898Z   no-cache: false
2021-04-20T14:45:15.9702304Z   pull: false
2021-04-20T14:45:15.9703198Z   github-token: ***
2021-04-20T14:45:15.9703639Z ##[endgroup]
2021-04-20T14:45:16.3155903Z 📣 Buildx version: 0.5.1
2021-04-20T14:45:16.3156772Z 🏃 Starting build...
2021-04-20T14:45:16.3213058Z [command]/usr/bin/docker buildx build --tag ***/apitemperature:latest --platform linux/arm/v7 --iidfile /tmp/docker-build-push-CcTisd/iidfile --cache-from type=local,src=/tmp/.buildx-cache --cache-to type=local,dest=/tmp/.buildx-cache --file ./APITemperature/Dockerfile --push .
2021-04-20T14:45:16.8524683Z #1 [internal] load build definition from Dockerfile
2021-04-20T14:45:16.8526175Z #1 sha256:31488bf030c607dfb904462da85e48090d86daaf4b0eb253a42fb88be6ab99c0
2021-04-20T14:45:16.8527446Z #1 transferring dockerfile: 789B 0.0s done
2021-04-20T14:45:16.8527982Z #1 DONE 0.0s
2021-04-20T14:45:16.8528263Z 
2021-04-20T14:45:16.8528738Z #2 [internal] load .dockerignore
2021-04-20T14:45:16.8530023Z #2 sha256:eb30ca1a72778adbefeaec967db640ec2f7ae4e94bec355fdb1f3f60b544610e
2021-04-20T14:45:17.0024566Z #2 transferring context: 358B done
2021-04-20T14:45:17.0025104Z #2 DONE 0.0s
2021-04-20T14:45:17.0025374Z 
2021-04-20T14:45:17.0026089Z #4 [internal] load metadata for mcr.microsoft.com/dotnet/aspnet:5.0
2021-04-20T14:45:17.0027358Z #4 sha256:df98d8a467c16a35cb8a03e607a3e5ff68ba71b77bfb872d36c8812708fb7356
2021-04-20T14:45:17.4240706Z #4 ...
2021-04-20T14:45:17.4243176Z 
2021-04-20T14:45:17.4244208Z #3 [internal] load metadata for mcr.microsoft.com/dotnet/sdk:5.0
2021-04-20T14:45:17.4246842Z #3 sha256:ae057f685b8251df61adbf8401f951b0576abc0c9d0e7dc876ee9cd3c103d2e9
2021-04-20T14:45:17.4248062Z #3 DONE 0.5s
2021-04-20T14:45:17.5590668Z 
2021-04-20T14:45:17.5591966Z #4 [internal] load metadata for mcr.microsoft.com/dotnet/aspnet:5.0
2021-04-20T14:45:17.5593820Z #4 sha256:df98d8a467c16a35cb8a03e607a3e5ff68ba71b77bfb872d36c8812708fb7356
2021-04-20T14:45:17.5595552Z #4 DONE 0.6s
2021-04-20T14:45:17.7094375Z 
2021-04-20T14:45:17.7095297Z #5 importing cache manifest from local:2872713443050105418
2021-04-20T14:45:17.7096433Z #5 sha256:b61bc4b455b0dc74317ca25d6cbb22424609b2e04e685401fa08754d30c20978
2021-04-20T14:45:17.7097383Z #5 DONE 0.0s
2021-04-20T14:45:17.7097687Z 
2021-04-20T14:45:17.7098135Z #11 [internal] load build context
2021-04-20T14:45:17.7099264Z #11 sha256:8c6fd30bbbe1675636ece6ce07377fdf2b34b451b04f77945fd61db18676f2f8
2021-04-20T14:45:17.7100434Z #11 transferring context: 39.94kB 0.0s done
2021-04-20T14:45:17.7100931Z #11 DONE 0.0s
2021-04-20T14:45:17.7101194Z 
2021-04-20T14:45:17.7102381Z #6 [base 1/2] FROM mcr.microsoft.com/dotnet/aspnet:5.0@sha256:c0cc95b0d87a31401763f8c7b2a25aa106e7b45bfcaa2f302dc9d0ff5ab93fa2
2021-04-20T14:45:17.7104201Z #6 sha256:c577ebacc45259a20da4a650e09ae539e281e550d7d5370bbbdf05d3c6296734
2021-04-20T14:45:17.7106054Z #6 resolve mcr.microsoft.com/dotnet/aspnet:5.0@sha256:c0cc95b0d87a31401763f8c7b2a25aa106e7b45bfcaa2f302dc9d0ff5ab93fa2 0.0s done
2021-04-20T14:45:17.8354599Z #6 sha256:5783bc1a9017c58328bb93eceb87903ef1882950cd7f38c381358e53b0e2c876 0B / 8.59MB 0.2s
2021-04-20T14:45:17.8356262Z #6 sha256:bda878649c866936e80ab702b25ec5a159daa4cc7d3ead2f3b2d206964cc25d2 0B / 29.68MB 0.2s
2021-04-20T14:45:17.8358016Z #6 sha256:24a233bfa7351886903a6d739111134bff0c3f3bbaed67fa212c78b4975c168b 0B / 154B 0.2s
2021-04-20T14:45:17.8359691Z #6 sha256:bdc9af7b439c9ef15ef901b20a73eebdafa6a03b5881a93ea43c09d43f776f59 8.39MB / 16.12MB 0.2s
2021-04-20T14:45:17.8361690Z #6 sha256:8c6bea184b33030fb923c3c09d634b73235dec3fe2d411db9fd22bda669f2c37 2.72MB / 22.74MB 0.2s
2021-04-20T14:45:17.9652130Z #6 sha256:5783bc1a9017c58328bb93eceb87903ef1882950cd7f38c381358e53b0e2c876 2.10MB / 8.59MB 0.3s
2021-04-20T14:45:17.9653905Z #6 sha256:bdc9af7b439c9ef15ef901b20a73eebdafa6a03b5881a93ea43c09d43f776f59 16.12MB / 16.12MB 0.3s done
2021-04-20T14:45:17.9655731Z #6 sha256:8c6bea184b33030fb923c3c09d634b73235dec3fe2d411db9fd22bda669f2c37 18.87MB / 22.74MB 0.3s
2021-04-20T14:45:18.0801242Z #6 sha256:5783bc1a9017c58328bb93eceb87903ef1882950cd7f38c381358e53b0e2c876 8.59MB / 8.59MB 0.5s
2021-04-20T14:45:18.0803584Z #6 sha256:24a233bfa7351886903a6d739111134bff0c3f3bbaed67fa212c78b4975c168b 154B / 154B 0.3s done
2021-04-20T14:45:18.0805478Z #6 sha256:8c6bea184b33030fb923c3c09d634b73235dec3fe2d411db9fd22bda669f2c37 22.74MB / 22.74MB 0.4s done
2021-04-20T14:45:18.0807192Z #6 extracting sha256:8c6bea184b33030fb923c3c09d634b73235dec3fe2d411db9fd22bda669f2c37
2021-04-20T14:45:18.2299319Z #6 sha256:5783bc1a9017c58328bb93eceb87903ef1882950cd7f38c381358e53b0e2c876 8.59MB / 8.59MB 0.5s done
2021-04-20T14:45:18.3772729Z #6 sha256:bda878649c866936e80ab702b25ec5a159daa4cc7d3ead2f3b2d206964cc25d2 11.53MB / 29.68MB 0.8s
2021-04-20T14:45:18.5268666Z #6 sha256:bda878649c866936e80ab702b25ec5a159daa4cc7d3ead2f3b2d206964cc25d2 16.78MB / 29.68MB 0.9s
2021-04-20T14:45:18.6768096Z #6 sha256:bda878649c866936e80ab702b25ec5a159daa4cc7d3ead2f3b2d206964cc25d2 25.17MB / 29.68MB 1.1s
2021-04-20T14:45:19.1269561Z #6 sha256:bda878649c866936e80ab702b25ec5a159daa4cc7d3ead2f3b2d206964cc25d2 29.68MB / 29.68MB 1.4s done
2021-04-20T14:45:19.2770888Z #6 extracting sha256:8c6bea184b33030fb923c3c09d634b73235dec3fe2d411db9fd22bda669f2c37 1.1s done
2021-04-20T14:45:19.2772809Z #6 extracting sha256:bdc9af7b439c9ef15ef901b20a73eebdafa6a03b5881a93ea43c09d43f776f59
2021-04-20T14:45:19.7274376Z #6 extracting sha256:bdc9af7b439c9ef15ef901b20a73eebdafa6a03b5881a93ea43c09d43f776f59 0.4s done
2021-04-20T14:45:19.7276299Z #6 extracting sha256:bda878649c866936e80ab702b25ec5a159daa4cc7d3ead2f3b2d206964cc25d2
2021-04-20T14:45:20.3282450Z #6 extracting sha256:bda878649c866936e80ab702b25ec5a159daa4cc7d3ead2f3b2d206964cc25d2 0.6s done
2021-04-20T14:45:20.3284216Z #6 extracting sha256:24a233bfa7351886903a6d739111134bff0c3f3bbaed67fa212c78b4975c168b done
2021-04-20T14:45:20.3285735Z #6 extracting sha256:5783bc1a9017c58328bb93eceb87903ef1882950cd7f38c381358e53b0e2c876
2021-04-20T14:45:20.4783763Z #6 extracting sha256:5783bc1a9017c58328bb93eceb87903ef1882950cd7f38c381358e53b0e2c876 0.2s done
2021-04-20T14:45:20.4784882Z #6 DONE 2.8s
2021-04-20T14:45:20.4785530Z 
2021-04-20T14:45:20.4786556Z #9 [build 1/7] FROM mcr.microsoft.com/dotnet/sdk:5.0@sha256:85ea9832ae26c70618418cf7c699186776ad066d88770fd6fd1edea9b260379a
2021-04-20T14:45:20.4788071Z #9 sha256:0d00a70370f81c372582259015e7fbdccd877b07d4409b05152d14e9fa29e545
2021-04-20T14:45:20.4789599Z #9 resolve mcr.microsoft.com/dotnet/sdk:5.0@sha256:85ea9832ae26c70618418cf7c699186776ad066d88770fd6fd1edea9b260379a 0.0s done
2021-04-20T14:45:20.4791322Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 2.7s
2021-04-20T14:45:20.4792858Z #9 sha256:f123f733188d3ed3512c733a9c57c6b50a41ce614078c32d17f9e59656929689 24.14MB / 24.14MB 0.7s done
2021-04-20T14:45:20.4794481Z #9 sha256:2d4575e6b4d4d83672f4a97ae481e068968b43e5bba3bc3e4816069609b05fdd 12.12MB / 12.12MB 0.6s done
2021-04-20T14:45:20.4795954Z #9 extracting sha256:f123f733188d3ed3512c733a9c57c6b50a41ce614078c32d17f9e59656929689
2021-04-20T14:45:22.7187857Z #9 ...
2021-04-20T14:45:22.7189696Z 
2021-04-20T14:45:22.7190225Z #7 [base 2/2] WORKDIR /app
2021-04-20T14:45:22.7191404Z #7 sha256:5c23f9805dd85e2afec193446c0f683d7c96032a135115b14ddfdb6df4958bfd
2021-04-20T14:45:22.7192508Z #7 DONE 2.3s
2021-04-20T14:45:22.7193155Z 
2021-04-20T14:45:22.7194660Z #9 [build 1/7] FROM mcr.microsoft.com/dotnet/sdk:5.0@sha256:85ea9832ae26c70618418cf7c699186776ad066d88770fd6fd1edea9b260379a
2021-04-20T14:45:22.7196568Z #9 sha256:0d00a70370f81c372582259015e7fbdccd877b07d4409b05152d14e9fa29e545
2021-04-20T14:45:22.7198260Z #9 extracting sha256:f123f733188d3ed3512c733a9c57c6b50a41ce614078c32d17f9e59656929689 2.3s done
2021-04-20T14:45:22.8689339Z #9 ...
2021-04-20T14:45:22.8689775Z 
2021-04-20T14:45:22.8690210Z #8 [final 1/2] WORKDIR /app
2021-04-20T14:45:22.8691402Z #8 sha256:cbffd7fd0ae0083e38548dcfffb11e308f00a71d953b479b3e1ea38f8fc7582c
2021-04-20T14:45:22.8692506Z #8 DONE 0.0s
2021-04-20T14:45:22.8692780Z 
2021-04-20T14:45:22.8693794Z #9 [build 1/7] FROM mcr.microsoft.com/dotnet/sdk:5.0@sha256:85ea9832ae26c70618418cf7c699186776ad066d88770fd6fd1edea9b260379a
2021-04-20T14:45:22.8695280Z #9 sha256:0d00a70370f81c372582259015e7fbdccd877b07d4409b05152d14e9fa29e545
2021-04-20T14:45:25.5718307Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 7.8s
2021-04-20T14:45:30.6765174Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 12.9s
2021-04-20T14:45:35.7813466Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 18.0s
2021-04-20T14:45:40.8869493Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 23.1s
2021-04-20T14:45:45.9920095Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 28.2s
2021-04-20T14:45:51.9547824Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 33.3s
2021-04-20T14:45:56.2024446Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 38.4s
2021-04-20T14:46:01.3075982Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 43.5s
2021-04-20T14:46:06.4127083Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 48.6s
2021-04-20T14:46:11.5173712Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 53.7s
2021-04-20T14:46:16.4693192Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 58.8s
2021-04-20T14:46:21.5692555Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 50.33MB / 101.24MB 63.9s
2021-04-20T14:46:25.9653724Z #9 67.99 error: failed to copy: read tcp 172.17.0.2:54176->131.253.33.219:443: read: connection reset by peer
2021-04-20T14:46:25.9655097Z #9 67.99 retrying in 1s
2021-04-20T14:46:27.1203732Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 61.87MB / 101.24MB 0.2s
2021-04-20T14:46:27.2705044Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 83.89MB / 101.24MB 0.3s
2021-04-20T14:46:27.4207278Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 95.42MB / 101.24MB 0.5s
2021-04-20T14:46:27.5707246Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 100.66MB / 101.24MB 0.6s
2021-04-20T14:46:27.8710117Z #9 sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 101.24MB / 101.24MB 1.0s done
2021-04-20T14:46:27.8711926Z #9 extracting sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0
2021-04-20T14:46:30.4226611Z #9 extracting sha256:a8347b3a1feb3898ec8dfc50429da45e1e17c563a4a35157d02c56819f9fcac0 2.5s done
2021-04-20T14:46:30.4228882Z #9 extracting sha256:2d4575e6b4d4d83672f4a97ae481e068968b43e5bba3bc3e4816069609b05fdd
2021-04-20T14:46:30.8732258Z #9 extracting sha256:2d4575e6b4d4d83672f4a97ae481e068968b43e5bba3bc3e4816069609b05fdd 0.4s done
2021-04-20T14:46:30.8733432Z #9 DONE 73.1s
2021-04-20T14:46:30.8733741Z 
2021-04-20T14:46:30.8734199Z #10 [build 2/7] WORKDIR /src
2021-04-20T14:46:30.8735339Z #10 sha256:43ac7aa94895d63bb0307f69eaa59d0917a25939cff1b1495a74ca45174bea91
2021-04-20T14:46:32.3729092Z #10 DONE 1.6s
2021-04-20T14:46:32.5229794Z 
2021-04-20T14:46:32.5231299Z #12 [build 3/7] COPY [APITemperature/APITemperature.csproj, APITemperature/]
2021-04-20T14:46:32.5233695Z #12 sha256:d09810ae2ccefe4219b8df5128bdd020d0e845df4f233eeaed26900113316a0a
2021-04-20T14:46:32.5235328Z #12 DONE 0.0s
2021-04-20T14:46:32.5235686Z 
2021-04-20T14:46:32.5236698Z #13 [build 4/7] RUN dotnet restore "APITemperature/APITemperature.csproj"
2021-04-20T14:46:32.5238617Z #13 sha256:49ec9cefad38e8249090ecba39417e2da86f6517f8810c31067ad63a5c7e6ff7
2021-04-20T14:46:32.5642823Z #13 0.149 A fatal error occurred, the folder [/usr/share/dotnet/host/fxr] does not contain any version-numbered child folders
2021-04-20T14:46:32.5660679Z #13 ERROR: executor failed running [/bin/sh -c dotnet restore "APITemperature/APITemperature.csproj"]: exit code: 131
2021-04-20T14:46:32.5662015Z ------
2021-04-20T14:46:32.5662786Z  > [build 4/7] RUN dotnet restore "APITemperature/APITemperature.csproj":
2021-04-20T14:46:32.5663632Z ------
2021-04-20T14:46:32.5664082Z Dockerfile:13
2021-04-20T14:46:32.5664665Z --------------------
2021-04-20T14:46:32.5665106Z   11 |     WORKDIR /src
2021-04-20T14:46:32.5665924Z   12 |     COPY ["APITemperature/APITemperature.csproj", "APITemperature/"]
2021-04-20T14:46:32.5667060Z   13 | >>> RUN dotnet restore "APITemperature/APITemperature.csproj"
2021-04-20T14:46:32.5667789Z   14 |     COPY . .
2021-04-20T14:46:32.5668299Z   15 |     WORKDIR "/src/APITemperature"
2021-04-20T14:46:32.5668978Z --------------------
2021-04-20T14:46:32.5670386Z error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c dotnet restore "APITemperature/APITemperature.csproj"]: exit code: 131
2021-04-20T14:46:32.5808114Z ##[error]buildx call failed with: error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c dotnet restore "APITemperature/APITemperature.csproj"]: exit code: 131
2021-04-20T14:46:32.5937546Z Post job cleanup.
2021-04-20T14:46:32.6860546Z 🚿 Removing temp folder /tmp/docker-build-push-CcTisd
2021-04-20T14:46:32.6962378Z Post job cleanup.
2021-04-20T14:46:32.7472709Z [command]/usr/bin/docker logout 
2021-04-20T14:46:32.8040667Z Removing login credentials for https://index.docker.io/v1/
2021-04-20T14:46:32.8189690Z Post job cleanup.
2021-04-20T14:46:32.8819799Z [command]/usr/bin/docker buildx rm builder-c0cc5836-daba-4418-aa07-003804840d19
2021-04-20T14:46:33.4718542Z Post job cleanup.
2021-04-20T14:46:33.5839655Z [command]/usr/bin/git version
2021-04-20T14:46:33.5895531Z git version 2.31.1
2021-04-20T14:46:33.5957268Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2021-04-20T14:46:33.6001316Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2021-04-20T14:46:33.6273184Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2021-04-20T14:46:33.6298080Z http.https://github.com/.extraheader
2021-04-20T14:46:33.6308210Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2021-04-20T14:46:33.6348266Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2021-04-20T14:46:33.6689104Z Cleaning up orphan processes
http://

Thanks a lot for for your helps !



Solution 1:[1]

I have the same problem. My workaround is doing a normal build (not using buildx) instead of linux/arm/v7. Please read this thread https://github.com/dotnet/dotnet-docker/issues/1537#issuecomment-615269150

You can do some changes in your dockerfile. Build with a multi-platform tag FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build Then publish with arm32v7 tag FROM mcr.microsoft.com/dotnet/aspnet:5.0-bullseye-slim-arm32v7 AS base

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vincent Shen