diff --git a/README.md b/README.md index 415fea2c..b7542dd1 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,17 @@ Contents All commands below are adopted for Ubuntu, other distributions may need an other command set. +## Build Gui and Daemon via docker +Result stored to save +$cd docker +$./make-bcn.sh + +You can try compiled (via script upper) docker image, via Dockerfile: +FROM homdx/bytecoin-docker + +#CMD ["/bin/walletd"] +#CMD ["/bin/bytecoind"] + ### Building with standard options To go futher you have to have a number of packages and utilities. diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..1b7b94c2 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,8 @@ +version: '2' +services: + devbcn: + build: + context: ./docker1 + dockerfile: Dockerfile-bcn + volumes: + - './save:/save' diff --git a/docker/docker1/Dockerfile-bcn b/docker/docker1/Dockerfile-bcn new file mode 100644 index 00000000..fd94a219 --- /dev/null +++ b/docker/docker1/Dockerfile-bcn @@ -0,0 +1,19 @@ +FROM fedora:27 +#Fedora image + +#FROM debian:stable +#FROM ubuntu:latest +#Debian and Ubuntu image + +#Fedora setup requirements +RUN dnf -y update && dnf -y install gcc-c++ boost-static boost-devel qt5-devel cmake git lmdb-devel openssl-devel && dnf clean all + +#Debian and Ubuntu setup requirements +#RUN apt-get -y update && apt-get -y install build-essential cmake libboost-all-dev liblmdb-dev git qtbase5-dev libssl-dev && apt-get clean all + +#Only for ubuntu docker: setup new version boost 1.64 +#RUN apt-get install -y wget && wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz && tar -xvf boost_1_64_0.tar.gz && cd boost_1_64_0 && ./bootstrap.sh && ./b2 install && cd / && rm -r boost_1_64_0 + +ADD ./src /src + +CMD /src/make-bcn-docker.sh diff --git a/docker/docker1/src/make-bcn-docker.sh b/docker/docker1/src/make-bcn-docker.sh new file mode 100755 index 00000000..b939f12f --- /dev/null +++ b/docker/docker1/src/make-bcn-docker.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +RESULT_MSG='Copy result build to save folder' + +git clone https://github.com/bcndev/bytecoin.git +cd bytecoin +git clone https://github.com/openssl/openssl.git +cd openssl +./Configure linux-x86_64 no-shared +time make -j4 +echo 'Copy source openssl and compiled' +cp ./include/openssl/* ./ +cp ./apps/openssl ./ +cd .. + +git clone https://github.com/LMDB/lmdb.git +mkdir -p build +cd build +cmake .. +time make -j4 + +echo $RESULT_MSG +cp -v ../bin/* /save + +cd ../.. +git clone https://github.com/bcndev/bytecoin-gui.git +cd bytecoin-gui +mkdir -p build +cd build +cmake .. +time make -j4 +echo $RESULT_MSG +cp -v ../bin/* /save + +echo Remove sources +cd ../.. && rm -rf bytecoin-gui && rm -rf bytecoin diff --git a/docker/make-bcn.sh b/docker/make-bcn.sh new file mode 100755 index 00000000..f6d2f30e --- /dev/null +++ b/docker/make-bcn.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +#If you enabled Selinux, you need this command: +#sudo chcon -Rt svirt_sandbox_file_t save + +echo 'Detect docker host system' +if df -h | grep atomic ; then +echo 'Atomic docker host' +export PATH=/usr/local/bin:$PATH +else +echo 'Another docker host' +fi + +function build +{ +if [ ! -d "save" ]; then + mkdir save +fi + +docker-compose build +} + +function up +{ +docker-compose up +} + +function leave +{ +echo 'Error compile' +/bin/false +} + +function info1 +{ +echo 'All compiled files at folder save' +ls -la save +} +echo 'Compile bytecoin devel (gui and daemon) with Docker' +build && up && info1 || leave