简体   繁体   中英

Azure iot edge: Solution does not build and push for arm32v7 platform in VSCode

I created an out the box template c# edge solution in VScode using the IoT tools but get the following error when trying to build and push the solution:

Step 4/12 : RUN dotnet restore
---> Running in 22c6f8ceb80c
A fatal error occurred, the folder [/usr/share/dotnet/host/fxr] does not contain any version-numbered child folders
The command '/bin/sh -c dotnet restore' returned a non-zero code: 131

This is clearly happening when its trying to run through the commands in Dockerfile.arm32v7 which has the following in it:

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster-arm32v7 AS build-env
WORKDIR /app

COPY *.csproj ./
RUN dotnet restore

COPY . ./
RUN dotnet publish -c Release -o out

FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm32v7
WORKDIR /app
COPY --from=build-env /app/out ./

RUN useradd -ms /bin/bash moduleuser
USER moduleuser

ENTRYPOINT ["dotnet", "SampleModule.dll"]

This only happens when building for arm32v7 but works for amd64. I'm building for use on raspberry pi so I need arm32.

Seems to me maybe a problem with my environment but not sure where to look? I've also seen some comments that you need to build on an ARM host machine if you want it to work but I haven't seen that in the documentation before and doesn't make sense from an ease of development point of view

When submitting a build using az acr build , you can pass in the parameter --platform linux/arm/v7 which should give you an ARM build environment.

If you prefer to build locally, you can try using the pulling the qemu package into the build context in the first stage of your Dockerfile.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM