Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
docker compose无法生成服务_Docker - Fatal编程技术网

docker compose无法生成服务

docker compose无法生成服务,docker,Docker,我正在使用oatpp web框架和集成mongodb模块,并克隆示例mongodb演示项目一个基本CRUD应用程序,其中oatpp和mongodb集成了swagger。我正在尝试从项目目录中打开的终端运行docker compose,但出现如下错误: $example-mongodb$docker-compose up Building example-service Step 1/11 : FROM lganzzzo/alpine-mongocxx:latest ---> a39b08

我正在使用oatpp web框架和集成mongodb模块,并克隆示例mongodb演示项目一个基本CRUD应用程序,其中oatpp和mongodb集成了swagger。我正在尝试从项目目录中打开的终端运行docker compose,但出现如下错误:

$example-mongodb$docker-compose up
Building example-service
Step 1/11 : FROM lganzzzo/alpine-mongocxx:latest
 ---> a39b08adb312
Step 2/11 : ADD src/ /service/src/
 ---> Using cache
 ---> ffeef3ce297b
Step 3/11 : ADD utility/ /service/utility/
 ---> Using cache
 ---> cb8dfbf0a2bf
Step 4/11 : ADD CMakeLists.txt /service/CMakeLists.txt
 ---> Using cache
 ---> 83e98f4a776d
Step 5/11 : WORKDIR /service/utility
 ---> Using cache
 ---> 50ea5d092947
Step 6/11 : RUN ./install-oatpp-modules.sh Release
 ---> Using cache
 ---> 2e6133bd640b
Step 7/11 : WORKDIR /service/build
 ---> Using cache
 ---> 498c1ccea65d
Step 8/11 : RUN cmake ..
 ---> Running in d5b368846760
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
LIBBSONCXX_INCLUDE_DIRS=
LIBBSONCXX_LIBRARIES=
LIBMONGOCXX_INCLUDE_DIRS=
LIBMONGOCXX_LIBRARIES=
-- Configuring done
CMake Error at CMakeLists.txt:74 (add_executable):
  Cannot find source file:

    test/tests.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

-- Build files have been written to: /service/build
CMake Error at CMakeLists.txt:74 (add_executable):
  No SOURCES given to target: example-mongodb-test

ERROR: Service 'example-service' failed to build: The command '/bin/sh -c cmake ..' returned a non-zero code: 1



我已经在我的本地系统上安装了docker和docker compose,并且已经在本地系统上设置了所有依赖项。

您在图像中添加了
src
utility
文件夹,但没有添加
test
文件夹。通过添加test文件夹,我想一切都会好的


addtest//service/test/

非常感谢您解决了问题,但现在出现了错误:例如mongodb\u mongodb\u 1 UnixHTTPConnectionPool(host='localhost',port=None):读取超时。(读取超时=60)错误:对于mongodb UnixHTTPConnectionPool(host='localhost',port=None):读取超时。(读取超时=60)错误:HTTP请求花费的时间太长而无法完成。使用--verbose重试以获取调试信息。如果由于网络条件缓慢而经常遇到此问题,请考虑将CeopeTHepPiTimeOUT设置为更高的值(当前值:60)。