我想从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/