docker - “dockerfile”文本文件忙

标签 docker makefile dockerfile

我想从dockerfile创建一个项目。首先,我应该从github克隆一个框架并安装它。
在我的Dockerfile中,我有以下指示:

RUN git clone https://github.com/simgrid/project.git
WORKDIR "/project"
RUN cmake option1 options2 .
RUN sudo make
RUN sudo make install 

我用以下方法构建图像:
docker build -t "myimage" . 

但是我有关于text file busy的错误。我该如何克服?
    make[2]: execvp: /simgrid/tools/sg_unit_extractor.pl: Text file busy
    make[2]: *** [src/cunit_unit.cpp] Error 127
    CMakeFiles/testall.dir/build.make:69: recipe for target 'src/cunit_unit.cpp' failed
    CMakeFiles/Makefile2:616: recipe for target 'CMakeFiles/testall.dir/all' failed
    make[1]: *** [CMakeFiles/testall.dir/all] Error 2
    Makefile:160: recipe for target 'all' failed
    make: *** [all] Error 2
    The command '/bin/sh -c sudo make' returned a non-zero code: 2

我的Dockerfile内容是:
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
            sudo \
            git \
            build-essential \ 
            cmake \
            libboost-dev \
            libboost-all-dev \
            doxygen \
            python3
RUN git clone https://github.com/simgrid/simgrid.git
WORKDIR "/simgrid"
RUN cmake -Denable_documentation=OFF -Denable_coverage=OFF -Denable_java=OFF -Denable_model-checking=OFF \
    -Denable_lua=OFF -Denable_compile_optimizations=OFF -Denable_smpi=OFF -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=OFF .
RUN sudo make 
RUN sudo make install

最佳答案

您看到的错误消息来自make的输出。对于Docker来说,这似乎不是一个错误。相反,这指向图像中正在编译的代码,因此您想在github中向他们提出此问题。

我确实看到有大量的内核和网络组件正在使用该应用程序编译,这些组件可能无法在docker沙箱中正常运行,因此您尝试编译的代码可能无法以这种隔离方式运行而不禁用某些功能docker提供的保护措施。有关更多详细信息,请参见docker's security documentation,尤其是有关 namespace ,cgroup和保护内核的功能。

关于docker - “dockerfile”文本文件忙,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40765066/

相关文章:

r - 如何在 docker 中加速 R 包的安装

docker-machine create 命令在等待 IP 时挂起

docker - 如何在 Docker for Windows 中实际绑定(bind)挂载文件

docker - Makefile docker 等待数据库准备就绪

docker - Marathon - 当返回代码 = 0 时不重新部署应用程序?

c++ - Clang 看不到标题

c++ - CMake 找不到 OpenCV 库

c - Mingw 和 make 变量

docker - .net core docker 镜像,每个客户都有应用程序设置

git - 使用主机 SSH key 在 DockerFile 中访问私有(private) Git 存储库