Dockerfile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # THIS DOCKERFILE DOWNLOADS AND COMPILES CURL, LIBMICROHTTPD, JSONCPP, ARGTABLE AND LIBJSON-RPC-CPP FOR LINUX/DEBIAN
  2. # 2015, author: Péricles Lopes Machado (gogo40) <pericles.raskolnikoff@gmail.com>
  3. # Based on Victor Laskin Dockerfile (http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/)
  4. FROM debian:sid
  5. MAINTAINER Péricles Lopes Machado <pericles.raskolnikoff@gmail.com>
  6. # Create output directories
  7. # Directory to export generated files
  8. RUN mkdir /output
  9. # Directory with generated files
  10. RUN mkdir /build && mkdir /build/include
  11. # Install compilation tools
  12. RUN apt-get update
  13. RUN apt-get install -y \
  14. wget \
  15. build-essential \
  16. cmake \
  17. libjsoncpp-dev \
  18. libargtable2-dev \
  19. libcurl4-openssl-dev \
  20. libmicrohttpd-dev \
  21. git
  22. # Clone and build libjson-rpc-cpp
  23. RUN git clone https://github.com/cinemast/libjson-rpc-cpp.git
  24. RUN cd /libjson-rpc-cpp && \
  25. cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=ON \
  26. /libjson-rpc-cpp
  27. RUN cd /libjson-rpc-cpp && \
  28. make -j $(nproc) && \
  29. make install
  30. # Copy to output generated files
  31. RUN cp -r /libjson-rpc-cpp/lib /build
  32. RUN cp -r /usr/local/include/jsonrpccpp /build/include/jsonrpccpp
  33. # To get the results run container with output folder
  34. # Example: docker run -v HOSTFOLDER:/output --rm=true IMAGENAME
  35. ENTRYPOINT cp -r /build/* /output