使用非零代码139执行构建Dockerfile [英] Building the Dockerfile executes with non-zero code 139

查看:509
本文介绍了使用非零代码139执行构建Dockerfile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

描述/复制步骤



我正在尝试运行opc-ua服务器示例 server_ctt(使用此处)在我的Raspberry Pi 1上的docker容器中,但是
我无法创建docker镜像。



我按照此处并首先克隆了仓库。
之后,我尝试通过在open62541目录中执行以下命令来构建映像:
docker build -f docker / Dockerfile。



这是我在终端中得到的输出:

  pi @ raspberrypi :〜/ ma / dockerVersion / open62541 $ docker build -f docker / Dockerfile。 
将构建上下文发送到Docker守护程序38.69MB
步骤1/18:从高山:3.10
3.10:从库/高山中拉出
4e972d957a60:拉出完整的
摘要: sha256:7c3773f7bcc969f03f8f653910001d99a9d324b4b9caa008846ad2c3089f5a5f
状态:已下载的较新的高山图片:3.10
---> cf7ea1e5a972
步骤2/18:运行apk添加--no-cache cmake gcc git g ++ musl-dev mbedtls-dev python py-pip make&& rm -rf / var / cache / apk / *
--->在82c8b5868509
中运行命令’/ bin / sh -c apk add --no-cache cmake gcc git g ++ musl-dev mbedtls-dev python py-pip make&& rm -rf / var / cache / apk / *'返回了非零代码:139

,我已使用便捷脚本此处 在我的树莓派上安装了docker p>

关于如何解决此问题的任何建议?



背景信息



我通过PuTTy连接到我的树莓派。但是我想这没什么不同。
此外,在Windows上构建映像并运行server_ctt示例可以很好地工作。



编辑:



在Windows PC上构建/运行open62541映像时,我尝试将其保存并复制到raspberry pi1。raspberry pi上的docker load命令工作正常,然后按照以下错误运行图像输出:

  standard_init_linux.go:211:exec用户进程导致 exec格式错误 

这可能是由于不同的体系结构(由于raspberry pi 1使用ARM体系结构)。我该如何解决?

解决方案

要回答更新的问题:您可以使用实验性 docker buildx 命令



这将创建一些虚拟化的构建器,这些构建器将为所需的体系结构构建您的容器。因此,构建过程可能会花费更长的时间(我认为对我的项目来说,实际因素是10)。



对于您的案例,最重要的命令是

  docker buildx build --platform linux / arm / v7。 


Description / Reproduction Steps

I am trying to run the opc-ua server examle "server_ctt" (using the open62541 library from here) within a docker container on my Raspberry Pi 1, but I am failing at creating the docker image.

I followed the instructions on here and cloned the repo at first. Afterwards, I try to build the image by executing the following command in the open62541 directory: docker build -f docker/Dockerfile .

This is the output I am getting in the terminal:

pi@raspberrypi:~/ma/dockerVersion/open62541 $ docker build -f docker/Dockerfile                         .
Sending build context to Docker daemon  38.69MB
Step 1/18 : FROM alpine:3.10
3.10: Pulling from library/alpine
4e972d957a60: Pull complete
Digest: sha256:7c3773f7bcc969f03f8f653910001d99a9d324b4b9caa008846ad2c3089f5a5f
Status: Downloaded newer image for alpine:3.10
 ---> cf7ea1e5a972
Step 2/18 : RUN apk add --no-cache cmake gcc git g++ musl-dev mbedtls-dev python py-pip make && rm -rf /var/cache/apk/*
 ---> Running in 82c8b5868509
The command '/bin/sh -c apk add --no-cache cmake gcc git g++ musl-dev mbedtls-dev python py-pip make && rm -rf /var/cache/apk/*' returned a non-zero code: 139

Beforehand, I have installed docker on my raspberry pi using the convenience script here

Any suggestions on how to solve this problem?

Background Information

I am connected to my raspberry pi via PuTTy. But I guess this doesn't make the difference. Furthermore, building the image on Windows and running the server_ctt example works completely fine.

EDIT:

As building/running the open62541 image is working on my windows pc, I have tried to save and copy it to my raspberry pi 1. The docker load command on my raspberry pi was working just fine put running the images outputs following erro:

standard_init_linux.go:211: exec user process caused "exec format error"

This may be due to different architectures (as raspberry pi 1 uses the ARM architecture). How can I solve this?

解决方案

To answer the updated question: You can build for your Raspberry Pi with the experimental docker buildx command.

This will create some virtualized builders that will build your container for the desired architectures. As such, the build process can take much longer (I think a factor of 10 is realistic for my projects).

The most important command for your case would be something like

docker buildx build --platform linux/arm/v7 .

这篇关于使用非零代码139执行构建Dockerfile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆