Skip to content

Commit

Permalink
Docker files added
Browse files Browse the repository at this point in the history
  • Loading branch information
kolobus committed Nov 19, 2016
1 parent 6d90c6d commit 32c6661
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:16.04
MAINTAINER Mihail Fedorov <[email protected]>

# All the stuff
# And clean out packages, keep space minimal
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get -y install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev \
unzip python zlib1g-dev wget bsdmainutils automake libboost-all-dev libssl-dev libprotobuf-dev \
protobuf-compiler libqt4-dev libqrencode-dev libdb++-dev software-properties-common libcurl4-openssl-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ADD ./ /komodo
ENV HOME /komodo
WORKDIR /komodo

# configure || true or it WILL halt
RUN cd /komodo && \
./autogen.sh && \
./configure --with-incompatible-bdb --with-gui || true && \
./zcutil/build.sh -j4

# Unknown stuff goes here

RUN ln -sf /komodo/src/komodod /usr/bin/komodod && \
ln -sf /komodo/zcutil/docker-entrypoint.sh /usr/bin/entrypoint && \
ln -sf /komodo/zcutil/docker-komodo-cli.sh /usr/bin/komodo-cli

CMD ["entrypoint"]

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

#set -ex

echo "...Checking komodo.conf"

if [ ! -e "$HOME/.komodo/komodo.conf" ]; then
mkdir -p $HOME/.komodo

echo "...Creating komodo.conf"
cat <<EOF > $HOME/.komodo/komodo.conf
rpcuser=${rpcuser:-komodorpc}
rpcpassword=${rpcpassword:-`dd if=/dev/urandom bs=33 count=1 2>/dev/null | base64`}
txindex=1
bind=${listenip:-127.0.0.1}
rpcbind=${listenip:-127.0.0.1}
addnode=5.9.102.210
addnode=78.47.196.146
addnode=178.63.69.164
addnode=88.198.65.74
addnode=5.9.122.241
addnode=144.76.94.38
EOF

cat $HOME/.komodo/komodo.conf
fi

echo "...Checking fetch-params"
$HOME/zcutil/fetch-params.sh

echo "Initialization completed successfully"
echo
if [ $# -gt 0 ]; then

args=("$@")

elif [ -z ${assetchain+x} ]; then

args=("-gen -genproclimit=${genproclimit:-2} -pubkey=${pubkey}")

else

args=("-pubkey=${pubkey} -ac_name=${assetchain} -addnode=${seednode}")

fi

echo
echo "****************************************************"
echo "Running: komodod ${args[@]}"
echo "****************************************************"

exec komodod ${args[@]}
11 changes: 11 additions & 0 deletions zcutil/docker-komodo-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
if [ -z ${assetchain+x} ]; then

/komodo/src/komodo-cli $1 $2 $3 $4

else

/komodo/src/komodo-cli -ac_name=$assetchain $1 $2 $3 $4

fi

0 comments on commit 32c6661

Please sign in to comment.