在GitHub存储库地址和该存储库的本地实例上运行时,是什么导致“docker build”的行为不同?
如何从Dockerfile本地构建此存储库 当我运行此命令时:在GitHub存储库地址和该存储库的本地实例上运行时,是什么导致“docker build”的行为不同?,docker,github,Docker,Github,如何从Dockerfile本地构建此存储库 当我运行此命令时: docker build https://github.com/mapillary/OpenSfM.git git clone https://github.com/mapillary/OpenSfM.git docker build OpenSfM 我得到了期望的结果: Successfully built f4e8d06f3d58 然而: 当我运行此命令时: docker build https://github.com/
docker build https://github.com/mapillary/OpenSfM.git
git clone https://github.com/mapillary/OpenSfM.git
docker build OpenSfM
我得到了期望的结果:
Successfully built f4e8d06f3d58
然而:
当我运行此命令时:
docker build https://github.com/mapillary/OpenSfM.git
git clone https://github.com/mapillary/OpenSfM.git
docker build OpenSfM
我发现了一个意想不到的错误:
CMake Error at CMakeLists.txt:53 (add_subdirectory):
The source directory
/source/OpenSfM/opensfm/src/third_party/pybind11
does not contain a CMakeLists.txt file.
CMake Error at bundle/CMakeLists.txt:49 (pybind11_add_module):
Unknown CMake command "pybind11_add_module".
-- Configuring incomplete, errors occurred!
See also "/source/OpenSfM/cmake_build/CMakeFiles/CMakeOutput.log".
See also "/source/OpenSfM/cmake_build/CMakeFiles/CMakeError.log".
Configuring for python 3.8...
Traceback (most recent call last):
File "setup.py", line 46, in <module>
configure_c_extension()
File "setup.py", line 37, in configure_c_extension
subprocess.check_call(cmake_command, cwd="cmake_build")
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '../opensfm/src', '-DPYTHON_EXECUTABLE=/usr/bin/python3']' returned non-zero exit status 1.
CMakeLists.txt:53(add_子目录)的CMake错误:
源目录
/source/OpenSfM/OpenSfM/src/third_party/pybind11
不包含CMakeLists.txt文件。
bundle/CMakeLists.txt:49(pybind11\u添加模块)处的CMake错误:
未知的CMake命令“pybind11\u添加\u模块”。
--配置不完整,出现错误!
另请参见“/source/OpenSfM/cmake_build/CMakeFiles/CMakeOutput.log”。
另请参见“/source/OpenSfM/cmake_build/CMakeFiles/CMakeError.log”。
正在为python 3.8配置。。。
回溯(最近一次呼叫最后一次):
文件“setup.py”,第46行,在
配置_c_扩展()
文件“setup.py”,第37行,在configure_c_扩展名中
子流程检查调用(cmake\u命令,cwd=“cmake\u构建”)
文件“/usr/lib/python3.8/subprocess.py”,第364行,在check\u调用中
引发被调用的进程错误(retcode,cmd)
subprocess.CalledProcessError:命令“['cmake','../opensfm/src','-DPYTHON_EXECUTABLE=/usr/bin/python3']”返回非零退出状态1。
我是Docker的新手,我的直觉告诉我,Docker的行为应该是一样的。事实并非如此。为什么?我该如何解决这个问题呢?这个存储库使用子模块,这意味着它们在某些文件夹中包含了其他repo,默认情况下不会克隆这些repo。(因此最终会丢失一些文件)可以使用以下命令进行递归克隆:
git clone --recurse-submodules https://github.com/mapillary/OpenSfM.git
Docker build以递归方式克隆repo,这就是在那里成功构建的原因。非常感谢您花时间帮助我。:)我很感激!很高兴我能帮忙!