diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..378eac25 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +build diff --git a/Dockerfile b/Dockerfile index 53b8cd1d..a9ce34fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,55 +1,64 @@ -FROM phusion/baseimage:0.9.19 +FROM ubuntu:18.04 MAINTAINER PeerPlays Blockchain Standards Association -ENV LANG=en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US.UTF-8 +ENV LC_ALL en_US.UTF-8 + RUN \ apt-get update -y && \ - apt-get install -y \ - g++ \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ autoconf \ - cmake \ - git \ - libbz2-dev \ - libreadline-dev \ - libboost-all-dev \ - libcurl4-openssl-dev \ - libssl-dev \ - libncurses-dev \ - doxygen \ + bash \ + build-essential \ ca-certificates \ + cmake \ + doxygen \ + git \ + graphviz \ + libbz2-dev \ + libcurl4-openssl-dev \ + libncurses-dev \ + libreadline-dev \ + libssl-dev \ + libtool \ + locales \ + pkg-config \ ntp \ wget \ && \ - apt-get update -y && \ - apt-get install -y fish && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN \ + sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ + locale-gen + ADD . /peerplays-core WORKDIR /peerplays-core -# Compile +# Compile Boost RUN \ - ( git submodule sync --recursive || \ - find `pwd` -type f -name .git | \ - while read f; do \ - rel="$(echo "${f#$PWD/}" | sed 's=[^/]*/=../=g')"; \ - sed -i "s=: .*/.git/=: $rel/=" "$f"; \ - done && \ - git submodule sync --recursive ) && \ - git submodule update --init --recursive && \ - BOOST_ROOT=$HOME/opt/boost_1_60_0 && \ - wget -c 'http://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.gz/download' -O boost_1_60_0.tar.gz &&\ - tar -zxvf boost_1_60_0.tar.gz && \ - cd boost_1_60_0/ && \ + BOOST_ROOT=$HOME/boost_1_67_0 && \ + wget -c 'http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.gz/download' -O boost_1_67_0.tar.gz &&\ + tar -zxvf boost_1_67_0.tar.gz && \ + cd boost_1_67_0/ && \ ./bootstrap.sh "--prefix=$BOOST_ROOT" && \ - ./b2 install -j$(nproc) && \ - cd .. && \ + ./b2 install && \ + cd .. + +# Compile Peerplays +RUN \ + BOOST_ROOT=$HOME/boost_1_67_0 && \ + git submodule update --init --recursive && \ + mkdir build && \ + mkdir build/release && \ + cd build/release && \ cmake \ -DBOOST_ROOT="$BOOST_ROOT" \ -DCMAKE_BUILD_TYPE=Release \ - . && \ - make witness_node cli_wallet -j$(nproc) && \ + ../.. && \ + make witness_node cli_wallet && \ install -s programs/witness_node/witness_node programs/cli_wallet/cli_wallet /usr/local/bin && \ # # Obtain version diff --git a/README.md b/README.md index 1c0f1cd5..8207bb29 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,35 @@ cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release make -j$(nproc) make install # this can install the executable files under /usr/local +``` + +docker build -t peerplays . + +## Docker image + +``` +# Install docker +sudo apt install docker.io + + +# Add current user to docker group +sudo usermod -a -G docker $USER +# You need to restart your shell session, to apply group membership +# Type 'groups' to verify that you are a member of a docker group + + +# Build docker image (from the project root, must be a docker group member) +docker build -t peerplays . + + +# Start docker image +docker start peerplays + +# Exposed ports +# # rpc service: +# EXPOSE 8090 +# # p2p service: +# EXPOSE 1776 ``` Rest of the instructions on starting the chain remains same.