尝试在Windows主机上运行Linux容器时出现IoT Edge代理错误:“图像操作系统” linux”不能在该平台上使用”

问题描述 投票:0回答:1

我正在尝试在Windows主机上创建Azure IoT Edge设备,但正在运行作为Linux容器构建的模块。在先前的实验中,我能够在Linux主机上成功创建Azure IoT Edge设备,并成功运行此相同的Linux容器模块。

但是,当我将模块部署到Windows主机上时,该模块显示该模块未运行,并且当我使用“ iotedge logs camera-capture”查看该模块的日志时,出现以下错误:

<6> 2019-12-02 13:32:56.016 -08:00 [INF] - Executing command: "Create module camera-capture"
<3> 2019-12-02 13:33:11.674 -08:00 [ERR] - Executing command for operation ["create"] failed.
Microsoft.Azure.Devices.Edge.Agent.Edgelet.EdgeletCommunicationException- Message:Error calling Create module camera-capture: Could not create module camera-capture
        caused by: Could not pull image localhost:5000/camera-capture-opencv:1.1.128-amd64
        caused by: image operating system "linux" cannot be used on this platform, StatusCode:500, at:   at Microsoft.Azure.Devices.Edge.Agent.Edgelet.Version_2019_01_30.ModuleManagementHttpClient.HandleException(Exception exception, String operation) in C:\agent\_work\4\s\edge-agent\src\Microsoft.Azure.Devices.Edge.Agent.Edgelet\version_2019_01_30\ModuleManagementHttpClient.cs:line 194

我在网上或通过Microsoft论坛未找到有关能够解决我的问题的特定错误的结果。作为记录,我确保:

  • 我正在运行兼容的Windows 10主机(17763)
  • 我安装了Hyper-V和容器
  • 我在BIOS中启用了VT
  • 我已将我的deployment.template.json配置为构建为“ amd64”平台
  • 我已将Docker桌面配置为使用Linux容器运行(并且还启用了实验模式)
  • 我已经在线测试了基本的“ hello-world” ubuntu示例,并且当我从Powershell运行它时它可以工作,这证明Linux容器将在我的Windows主机上运行

任何帮助将不胜感激!

docker-for-windows azure-iot-edge docker-desktop linux-containers
1个回答
0
投票

经过几天的努力,我终于找到了解决方案。问题在于Windows上的IoT Edge运行时未配置为处理Linux容器!撰写本文时,Microsoft在此处记录了该解决方案:https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-windows-with-linux

但是如果将来出现死链接,则基本上必须在安装Azure IoT Edge运行时来处理Linux容器时添加其他标志。

. {Invoke-WebRequest -useb aka.ms/iotedge-win} | Invoke-Expression; `
Deploy-IoTEdge -ContainerOs Linux
. {Invoke-WebRequest -useb aka.ms/iotedge-win} | Invoke-Expression; `
Initialize-IoTEdge -ContainerOs Linux
© www.soinside.com 2019 - 2024. All rights reserved.