![](/img/trans.png)
[英]Azure IoT Edge Module : Error while Build and Push IoT Edge Solution
[英]Azure iot edge: Solution does not build and push for arm32v7 platform in VSCode
我使用 IoT 工具在 VScode 中創建了一個開箱即用的模板 c# 邊緣解決方案,但在嘗試構建和推送解決方案時出現以下錯誤:
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
當它試圖運行 Dockerfile.arm32v7 中的命令時,顯然會發生這種情況,其中包含以下內容:
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"]
這僅在為 arm32v7 構建但適用於 amd64 時發生。 我正在構建用於樹莓派,所以我需要 arm32。
在我看來,我的環境可能有問題,但不知道去哪里看? 我還看到了一些評論,如果你想讓它工作,你需要在 ARM 主機上構建,但我之前在文檔中沒有看到,從易於開發的角度來看沒有意義
使用az acr build
提交構建時,您可以傳入參數--platform linux/arm/v7
,它應該為您提供 ARM 構建環境。
如果您更喜歡在本地構建,您可以嘗試在 Dockerfile 的第一階段將 qemu package 拉入構建上下文。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.