Skip to content

Commit

Permalink
Merge pull request #114 from gogo40/master
Browse files Browse the repository at this point in the history
Dockerfile to build the linux version of libjson-rpc-cpp in a Linux/Debian container
  • Loading branch information
cinemast committed Jun 20, 2015
2 parents 934e0fa + 1798576 commit 47a85e5
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
54 changes: 54 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# THIS DOCKERFILE DOWNLOADS AND COMPILES CURL, LIBMICROHTTPD, JSONCPP, ARGTABLE AND LIBJSON-RPC-CPP FOR LINUX/DEBIAN

# 2015, author: Péricles Lopes Machado (gogo40) <[email protected]>
# Based on Victor Laskin Dockerfile (http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/)

FROM debian:sid

MAINTAINER Péricles Lopes Machado <[email protected]>

# Create output directories

# Directory to export generated files
RUN mkdir /output

# Directory with generated files
RUN mkdir /build && mkdir /build/include

# Install compilation tools

RUN apt-get update

RUN apt-get install -y \
wget \
build-essential \
cmake \
libjsoncpp-dev \
libargtable2-dev \
libcurl4-openssl-dev \
libmicrohttpd-dev \
git

# Clone and build libjson-rpc-cpp

RUN git clone https://github.com/cinemast/libjson-rpc-cpp.git

RUN cd /libjson-rpc-cpp && \
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=ON \
/libjson-rpc-cpp

RUN cd /libjson-rpc-cpp && \
make -j $(nproc) && \
make install

# Copy to output generated files

RUN cp -r /libjson-rpc-cpp/lib /build
RUN cp -r /usr/local/include/jsonrpccpp /build/include/jsonrpccpp

# To get the results run container with output folder
# Example: docker run -v HOSTFOLDER:/output --rm=true IMAGENAME

ENTRYPOINT cp -r /build/* /output


5 changes: 5 additions & 0 deletions docker/build_linux_debian_libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

docker build -t debian/libjson-rpc-cpp .
docker run -v $PWD/output:/output --rm=true debian/libjson-rpc-cpp

0 comments on commit 47a85e5

Please sign in to comment.