Skip to content

Commit c340e68

Browse files
committedSep 17, 2015
Initial commit from github/mazaclub/docker-dashpay-base
1 parent 59f00b1 commit c340e68

File tree

9 files changed

+141
-23
lines changed

9 files changed

+141
-23
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dockerfile.local

‎Dockerfile

+46-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
1-
FROM phusion/baseimage
2-
# IMAGE mazaclub/coind-base
3-
RUN apt-get update \
4-
&& apt-get install -y libboost-all-dev \
5-
dh-autoreconf \
6-
libcurl4-openssl-dev \
7-
git apg libboost-all-dev build-essential \
8-
&& curl http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz -o db-4.8.30.NC.tar.gz \
9-
&& tar -xf db-4.8.30.NC.tar.gz \
10-
&& cd db-4.8.30.NC/build_unix \
11-
&& mkdir -p build \
12-
&& BDB_PREFIX=$(pwd)/build \
13-
&& ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX \
14-
&& make install \
15-
&& cd / \
16-
&& rm -rf /etc/service/* \
17-
&& apt-get autoremove -y \
18-
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1+
# version 1.4-1
2+
FROM mazaclub/coind-base
3+
# IMAGE mazaclub/dashd-base
4+
MAINTAINER guruvan "guruvan@maza.club"
195

20-
ENV BDB_PREFIX=/db-4.8.30.NC/build_unix/build
21-
COPY . /
6+
#XPOSE RPC P2P Testnet
7+
CMD ["/sbin/my_init"]
8+
VOLUME ["/home/coin"]
9+
EXPOSE 9998 9999
10+
11+
ENV BUILDER DOCKERHUB
12+
ENV WORKDIR $(pwd)
13+
ENV IMAGE mazaclubh/dashd-base
14+
ENV APP dashd
15+
ENV COIN dash
16+
ENV COIN_SYM dash
17+
ENV STAGE PROD
18+
RUN set -x && apt-get update \
19+
&& apt-get install -y libtool \
20+
wget bsdmainutils autoconf \
21+
apg libqrencode-dev libcurl4-openssl-dev \
22+
automake make ntp git build-essential \
23+
libssl-dev libboost-all-dev \
24+
&& export COIN=dash \
25+
&& export APP=dashd \
26+
&& if [ "${BUILDER}" = "LOCAL" ] ; then export MAKEJOBS="-j3" ; else export MAKEJOBS="" ; fi \
27+
&& git clone https://github.com/dashpay/dash ${COIN} \
28+
&& cd ${COIN} \
29+
&& export BDB_INCLUDE_PATH="${BDB_PREFIX}/include" \
30+
&& export BDB_LIB_PATH="/db-4.8.30.NC/build_unix" \
31+
&& ./autogen.sh \
32+
&& LDFLAGS="-L${BDB_PREFIX}/lib" CPPFLAGS="-I${BDB_PREFIX}/include/ ${CPPFLAGS}" ./configure --enable-cxx --disable-shared --with-pic \
33+
&& cd src \
34+
&& sed -i 's/USE_UPNP\:\=0/USE_UPNP\:\=\-/g' Makefile \
35+
&& make \
36+
&& make ${MAKEJOBS} install \
37+
&& mv ${APP} /usr/local/bin/ \
38+
&& cd / \
39+
&& rm -rf /dash
40+
41+
42+
COPY . /
43+
RUN chmod 700 /etc/service/dashd/run \
44+
&& groupadd --gid 2211 coin \
45+
&& adduser --disabled-password --gecos "dash" --uid 2211 --gid 2211 coin \
46+
&& chown -R coin.coin /home/coin \
47+
&& chmod 600 /home/coin/.dash/dash.conf

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# docker-coind-base
2-
Base image for all newer coind images - provides bdb 4.8.
1+
# docker-dashd-base
2+
dashd dockerimage - automated build

‎build_local.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# change BUILDER
4+
5+
sed -e 's/DOCKERHUB/LOCAL/g' Dockerfile > Dockerfile.local
6+
7+
#set MAKEJOBS
8+
# protable enough for now
9+
procs=$(grep processor /proc/cpuinfo | wc -l)
10+
procs=$((procs+1))
11+
sed -i -e 's/\-j3/\-j'${procs}'/g' Dockerfile.local
12+
13+
IMAGE="$(grep IMAGE Dockerfile | awk '{print $3}' )"
14+
15+
docker build -f Dockerfile.local -t ${IMAGE} .
16+
17+

‎etc/service/dashd/run

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
source /etc/container_environment.sh
3+
TXINDEX=${TXINDEX:-0}
4+
REINDEX=${REINDEX:-0}
5+
USER=${USER:-coin}
6+
COIN=${COIN:-dash}
7+
COIN_SYM=${COIN_SYM:dash}
8+
COINDIR=${COINDIR:-/home/coin/.${COIN}}
9+
RPCPASSWORD=${RPCPASSWORD}
10+
RPCPORT=${RPCPORT:-9998}
11+
P2PPORT=${P2PPORT:-9999}
12+
13+
#
14+
sed '/reindex/d' ${COINDIR}/${COIN}.conf > new
15+
mv new ${COINDIR}/${COIN}.conf
16+
sed '/txindex/d' ${COINDIR}/${COIN}.conf > new
17+
mv new ${COINDIR}/${COIN}.conf
18+
19+
20+
mk_rpcpass () {
21+
echo "$(date +%m-%d:%Y:%H:%M) making rpcpassword"
22+
sed -i '/rpcpassword/d' "${COINDIR}"/${COIN}.conf
23+
pass="$(apg -a0 -n1 -m64 -x64)"
24+
echo "rpcpassword=${pass}" >> "${COINDIR}"/${COIN}.conf
25+
}
26+
27+
if [ "${REINDEX}" = "1" ]
28+
then
29+
echo "reindex=1" >> "${COINDIR}"/${COIN}.conf
30+
fi
31+
if [ "${TXINDEX}" = "1" ]
32+
then
33+
echo "txindex=1" >> "${COINDIR}"/${COIN}.conf
34+
fi
35+
echo "$(date +%m-%d:%Y:%H:%M) Checking to see if this is the first known start of dashd ${COINDIR}"
36+
rpcpwd=$(grep rpcpassword ${COINDIR}/${COIN}.conf|awk -F\= '{print $2}')
37+
if [ ! -f "${COINDIR}"/${COIN}.conf ]
38+
then
39+
test -d "${COINDIR}" || mkdir -pv "${COINDIR}"
40+
cp -av /root/${COIN}.conf "${COINDIR}"/${COIN}.conf
41+
mk_rpcpass
42+
fi
43+
if [ -z "${rpcpwd}" ]
44+
then
45+
mk_rpcpass
46+
fi
47+
echo "$(date +%m-%d:%Y:%H:%M) Starting ${COIN}d"
48+
chown -R ${USER}.${USER} ${COINDIR}
49+
exec su - ${USER} -c "/usr/local/bin/${COIN}d"

‎etc/version.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION=0.1.1
1+
VERSION=0.1.1-04bd213

‎home/coin/.dash/dash.conf

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
rpcuser=coin_rpc
2+
port=9999
3+
rpcport=9998
4+
server=1
5+
daemon=0
6+
rpcallowip=127.0.0.1
7+
rpcallowip=172.17.0.0/16
8+
rpcallowip=10.0.0.0/8
9+
listen=1

‎root/dash.conf

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
rpcuser=coin_rpc
2+
port=9999
3+
rpcport=9998
4+
server=1
5+
daemon=0
6+
rpcallowip=127.0.0.1
7+
rpcallowip=172.17.0.0/16
8+
rpcallowip=10.0.0.0/8
9+
listen=1

‎run-dashd-docker.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
docker run -d \
2+
--name nmc_daemon \
3+
-e TXINDEX=1 \
4+
-e RPCPORT=9998 \
5+
-e P2PPORT=9999 \
6+
-v /opt/BIGDISK/NMC/home/coin:/home/coin \
7+
mazaclub/dashd-base

0 commit comments

Comments
 (0)
Please sign in to comment.