我一直在尝试使用cmake在docker中编译一个项目。但是,我收到以下错误:
cmake: /build/cmake-pCygIN/cmake-3.13.4/Source/cmOutputConverter.cxx:125: static std::__cxx11::string cmOutputConverter::ForceToRelativePath(const string&, const string&): Assertion `local_path.empty() || local_path[local_path.size() - 1] != '/'' failed.
这是使用以下 Dockerfile 作为 helloworld c 脚本
WORKDIR .
COPY ./ ./
RUN apt-get update && apt-get -y install cmake
WORKDIR ./build
RUN cmake .. && make
cmake 命令在我的家庭环境中运行良好。我认为这是因为我没有在 docker 环境中安装某些东西,但我不确定它会是什么。
如果其他人遇到此问题,则问题出在根目录中运行 cmake。将所有代码移入./src/
文件,并将 dockerfile 更改为:
FROM python:3.7
WORKDIR .
COPY ./ ./
RUN apt-get update && apt-get -y install cmake
WORKDIR ./build
RUN cmake ../src && make
修复了问题
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)