docker #2816
Answered
by
nlohmann
geigerzaehler242
asked this question in
Q&A
docker
#2816
-
hi how can i use this library with docker? below is my dockerfile and also my cmake.txt file i am trying to use: it all works fine locally for me but i can't figure out how to make this library work on docker. #dockerfile
FROM ubuntu:groovy
RUN apt-get update && \
apt-get install -y build-essential git cmake autoconf libtool pkg-config
RUN git clone https://github.com/nlohmann/json
WORKDIR /submission
COPY CMakeLists.txt main.cpp sample_input.json ./
RUN cmake . && make
CMD ["./sde-test-solution", "sample_input.json", "output_file.json"] #cmake.txt
cmake_minimum_required(VERSION 3.11)
project(sde-test-solution)
set(CMAKE_CXX_STANDARD 20)
find_package(nlohmann_json 3.2.0 REQUIRED)
target_link_libraries(sde-test-solution PRIVATE nlohmann_json::nlohmann_json)
add_executable(sde-test-solution main.cpp) |
Beta Was this translation helpful? Give feedback.
Answered by
nlohmann
Jun 14, 2021
Replies: 1 comment 7 replies
-
You need to install the library to use it in CMake like this, see https://github.com/nlohmann/json#cmake. This is independent to Docker. |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
nlohmann
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to install the library to use it in CMake like this, see https://github.com/nlohmann/json#cmake. This is independent to Docker.