Skip to content

Commit 47a85e5

Browse files
committed
Merge pull request #114 from gogo40/master
Dockerfile to build the linux version of libjson-rpc-cpp in a Linux/Debian container
2 parents 934e0fa + 1798576 commit 47a85e5

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

docker/Dockerfile

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

docker/build_linux_debian_libs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
docker build -t debian/libjson-rpc-cpp .
4+
docker run -v $PWD/output:/output --rm=true debian/libjson-rpc-cpp
5+

0 commit comments

Comments
 (0)