oatpp / oatpp-starter

Oatpp simple-API starter project
https://oatpp.io/
Apache License 2.0
72 stars 35 forks source link

Docker run gives error #20

Closed kushnertodd closed 1 year ago

kushnertodd commented 1 year ago

oatpp-starter builds and runs from the commandline in Ubuntu, but docker build fails. Latest commit:

commit 2eab7b49ad52507a1f9d7324db22908ab735c00c (HEAD -> master, origin/master, origin/HEAD) Author: Leonid Stryzhevskyi lganzzzo@gmail.com Date: Fri Dec 17 02:58:18 2021 +0200

output:

$ oatpp-starter (master)]$ docker run -p 8000:8000 -t oatpp-starter

=> ERROR [6/7] RUN cmake ..

[6/7] RUN cmake ..: 0.506 -- The C compiler identification is GNU 6.4.0 0.552 -- The CXX compiler identification is GNU 6.4.0 0.559 -- Check for working C compiler: /usr/bin/cc 0.623 -- Check for working C compiler: /usr/bin/cc -- works 0.624 -- Detecting C compiler ABI info 0.680 -- Detecting C compiler ABI info - done 0.690 -- Detecting C compile features 0.859 -- Detecting C compile features - done 0.864 -- Check for working CXX compiler: /usr/bin/c++ 0.948 -- Check for working CXX compiler: /usr/bin/c++ -- works 0.949 -- Detecting CXX compiler ABI info 1.041 -- Detecting CXX compiler ABI info - done 1.052 -- Detecting CXX compile features 1.354 -- Detecting CXX compile features - done 1.356 CMake Error at CMakeLists.txt:18 (find_package): 1.356 By not providing "Findoatpp.cmake" in CMAKE_MODULE_PATH this project has 1.356 asked CMake to find a package configuration file provided by "oatpp", but 1.356 CMake did not find one. 1.356 1.356 Could not find a package configuration file provided by "oatpp" (requested 1.356 version 1.3.0) with any of the following names: 1.356 1.356 oatppConfig.cmake 1.356 oatpp-config.cmake 1.356 1.356 Add the installation prefix of "oatpp" to CMAKE_PREFIX_PATH or set 1.356 "oatpp_DIR" to a directory containing one of the above files. If "oatpp" 1.356 provides a separate development package or SDK, be sure it has been 1.356 installed. 1.356 1.356 1.357 -- Configuring incomplete, errors occurred! 1.357 See also "/service/build/CMakeFiles/CMakeOutput.log".

Dockerfile:11

9 | WORKDIR /service/build 10 | 11 | >>> RUN cmake .. 12 | RUN make 13 |

ERROR: failed to solve: process "/bin/sh -c cmake .." did not complete successfully: exit code: 1

kushnertodd commented 1 year ago

The cmake and Ubuntu versions used are:

$ cmake --version cmake version 3.27.0-rc4

$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy

Builds and runs fine outside docker.

tommykoning commented 1 year ago

the cmake image they use is outdated which which causes the install-oatpp-modules.sh to break partly through you can fix it by going into the .dockerfile and replacing

FROM lganzzzo/alpine-cmake:latest

with

FROM gcc:latest

RUN set -ex;                                                                      \
    apt-get update;                                                               \
    apt-get install -y cmake libzmq3-dev;

you also might need to prune the build catches

kushnertodd commented 1 year ago

Perfect.

kushnertodd commented 1 year ago

Works as intended. Thanks.