Je souhaite installer la bibliothèque yaml-cpp
.Installation de la bibliothèque dans le docker
Pour installer sur Ubuntu (sur mon PC) Je habituellement cloné à partir github et effectuez les opérations suivantes:
cmake cmake [-G generator] [-DBUILD_SHARED_LIBS=ON|OFF] ..
make
make install
Et cela fonctionne très bien.
Je fais les mêmes étapes dans Docker. Puis-je commencer MyProject
et lier contre yaml-cpp
bibliothèque CMakeLists.txt
(target_link_libraries(MyProject yaml-cpp)
)
Mais je l'erreur lorsque je tente de lancer dans le fichier exécutable:
./MyProject: error while loading shared libraries: libyaml-cpp.so.0.5: cannot open shared object file: No such file or directory
UPD
Mon Dockerfile
est :
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
sudo \
git \
build-essential \
cmake \
libboost-dev \
libboost-all-dev \
doxygen \
unzip \
python3 \
wget
## Install SimGrid
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 sync; sudo make; sudo make install;
RUN cd lib && sudo cp * /usr/lib; cd ../include && sudo cp -a * /usr/include
## Install yaml-cpp parser
RUN git clone https://github.com/jbeder/yaml-cpp.git
WORKDIR "/yaml-cpp"
RUN mkdir build && cd build && cmake -DBUILD_SHARED_LIBS=ON .. && cd .. && make && make install
# LHCb grid simulation project
WORKDIR "/"
RUN git clone https://github.com/skygrid/grid_simulation.git
WORKDIR "/grid_simulation"
RUN sudo sysctl -w vm.max_map_count=500000
CMD ["./run.sh"]
certains plus d'informations sur votre dockerfile serait grand – clue404
poster votre Dockerfile afin que nous puissions voir comment vous construisez cette image. – gbolo
@ ro0kie4 @gbolo J'ai ajouté 'Dockerfile' –