【问题标题】:Azure IoT Edge Module : Error while Build and Push IoT Edge SolutionAzure IoT Edge 模块:构建和推送 IoT Edge 解决方案时出错
【发布时间】:2019-02-13 14:13:20
【问题描述】:

我按照这个教程一步一步来的:https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-c-module

但在“构建并推送您的解决方案”步骤(https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-c-module#build-and-push-your-solution)我在终端中出现以下错误:

standard_init_linux.go:207: exec user process caused "no such file or directory"

我检查了教程中列出的 3 点(“如果您在尝试构建和推送模块时收到错误”),但我仍然遇到错误。

我什至不知道它是关于什么文件的..

有人知道这个问题吗?

谢谢

编辑

我添加了所有的终端输出:

Sending build context to Docker daemon    106kB
Step 1/14 : FROM arm32v7/ubuntu:xenial AS base
 ---> 8593318db04f
Step 2/14 : RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common && add-apt-repository -y ppa:aziotsdklinux/ppa-azureiot && apt-get update && apt-get install -y azure-iot-sdk-c-dev && rm -rf /var/lib/apt/lists/*
 ---> Running in 8bed4f396527
standard_init_linux.go:207: exec user process caused "no such file or directory"
The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends software-properties-common && add-apt-repository -y ppa:aziotsdklinux/ppa-azureiot && apt-get update && apt-get install -y azure-iot-sdk-c-dev && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 1

【问题讨论】:

  • 当你在代码中使用docker login这个命令时,你确定你放的参数是对的吗?
  • 是的,我确定,结果是Login Succeeded

标签: azure docker azure-iot-hub azure-iot-edge azure-container-registry


【解决方案1】:

看起来您的命令中的路径之一在中间 docker 映像中找不到。尝试使用以下命令直接在中间映像上运行 shell:

docker run -it --entrypoint sh 8593318db04f

检查 /var/lib/apt/lists//bin/sh 是否确实存在于图像上。您应该能够手动运行 docker 文件中指定的命令。

我发现这对调试失败的 docker 构建很有帮助。

【讨论】:

  • 还是同样的错误:standard_init_linux.go:207: exec user process caused "no such file or directory"...
  • 所以要清楚,您登录到图像并直接运行命令并收到相同的错误?在这种情况下,您能否验证图像上是否存在这些路径?
  • 我执行了docker run -it --entrypoint sh 8593318db04f(使用正确的容器ID)并且我有standard_init_linux.go:207: exec user process caused "no such file or directory"
【解决方案2】:

看来您正在构建 arm32v7 映像,那么您的主机是什么操作系统?可以尝试构建 amd64 镜像而不是 arm32v7 吗?

【讨论】:

  • 你在 Ubuntu (amd64) 上使用 Visual Studio Code,但我的模块将在树莓派上运行,所以我需要为 arm 平台构建。如果我为 AMD 构建,没问题
  • arm32v7 镜像只能在 arm32v7 主机上构建。所以请尝试在树莓派上构建它
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多