“dockerfile”文本文件忙

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

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

我用以下方式构build图像

 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中提出这个问题。

我看到有相当数量的内核和networking组件正在与应用程序一起编译,这可能无法在docker沙盒中正常运行,所以您正在尝试编译的代码可能无法在此类隔离中运行而不禁用某些docker工提供的保护。 有关更多详细信息,请参阅docker的安全性文档 ,特别是有关名称空间,cgroup和保护内核的function。