Hi everyone,
I've finished building a docker container that comes with the following features:
1. based on Debian:wheezy
2. current casinocoind wallet v1.3
3. fully configured with monit to ensure the service stays running
4. on first run it will generate a unique rpc user and rpc password
5. comes bootstrapped with approximately 91k blocks for faster sync
6. starting the container starts monit and casinocoind
In addition to publishing the docker container to docker-registry, I will also post the Dockerfile here for your review and if you would like, you can compile your own container.
Making Casinocoin available in a docker container means that a user can download it and have a running, fully configured and bootstrapped instance of the wallet in a matter of minutes. For integration, testing, etc - this should prove to be a very useful tool.
This is the first container I've published publicly. If anyone finds any issues with the container or the instructions, please tell me, so i can correct them. I'm pushing the container now while I post this. It should be larger than 1Gb. SO, it may be an hour or so until it's available to pull.
Enjoy!
Goldseal
Resources:
Casinocoin Docker Container:
https://registry.hub.docker.com/u/qwerty55/casinocoin/Docker Application:
https://www.docker.com/Docker Hub (registry):
https://registry.hub.docker.com/Instructions:
1. Install Docker on your server or workstation:
https://docs.docker.com/installation/2. Execute:
docker run -i -t qwerty55/casinocoin:v1.3.0
3. Once attached to the container, casinocoin should take about 1 minute to read the blocks and be available for use.
4. Try out the following:
monit status
casinocoind getinfo
If anyone is interested in makign their own docker container form scratch, here's the dockerfile that I created. This would go into a new directory such as: /usr/src/tmp/Dockerfile and then you should copy .casinocoin from a working installation into /usr/src/tmp/casinocoin without the DOT. Finally, to prepare that directory, remove the wallet.dat and remove the rpcuser and rpcpassword entries from the config. If you do not wish to bootstrap the docker container with blocks, then strip out everything from "ADD casinocoin casinocoin" down.
Once the directory and Dockerfile are complete, just run the following to build and run it locally:
cd /usr/src/tmp && docker build -t casinocoin .
docker run -t -i casinocoin
Dockerfile:
FROM debian:wheezy
# File Author / Maintainer
MAINTAINER qwerty55
RUN apt-get update
RUN apt-get install time -y
RUN time apt-get upgrade -y
RUN time apt-get install -y git build-essential libssl-dev libdb5.1-dev libdb5.1++-dev libboost-all-dev libqrencode-dev
WORKDIR /usr/src
RUN git clone https://github.com/casinocoin/casinocoin.git
WORKDIR /usr/src/casinocoin/src
RUN make -f makefile.unix -e PIE=1
RUN mv casinocoind /usr/bin
RUN chmod 755 /usr/bin/casinocoind
WORKDIR /root/
RUN rm -rf /usr/src/casinocoin
RUN apt-get remove build-essential -y
RUN apt-get install monit uuid-runtime apt-utils -y
RUN echo "check process casinocoind with pidfile /var/run/casinocoind.pid" > /etc/monit/conf.d/casinocoin
RUN echo " start program = \"/usr/bin/casinocoind -pid=/var/run/casinocoind.pid -datadir=/root/.casinocoin --daemon\"" >> /etc/monit/conf.d/casinocoin
RUN echo " stop program = \"/usr/bin/casinocoind stop\"" >> /etc/monit/conf.d/casinocoin
RUN echo " if failed port 57950 for 3 cycles then restart" >> /etc/monit/conf.d/casinocoin
RUN echo " if 50 restarts within 50 cycles then timeout" >> /etc/monit/conf.d/casinocoin
RUN echo "set daemon 600" > /etc/monit/monitrc
RUN echo "set mailserver localhost" >> /etc/monit/monitrc
RUN echo "set logfile /var/log/monit.log" >> /etc/monit/monitrc
RUN echo "set idfile /var/lib/monit/id" >> /etc/monit/monitrc
RUN echo "set statefile /var/lib/monit/state" >> /etc/monit/monitrc
RUN echo "set eventqueue" >> /etc/monit/monitrc
RUN echo " basedir /var/lib/monit/events" >> /etc/monit/monitrc
RUN echo " slots 100" >> /etc/monit/monitrc
RUN echo "set httpd port 2812 and" >> /etc/monit/monitrc
RUN echo " use address localhost" >> /etc/monit/monitrc
RUN echo " allow localhost" >> /etc/monit/monitrc
RUN echo "set alert root@localhost" >> /etc/monit/monitrc
RUN echo "include /etc/monit/conf.d/*" >> /etc/monit/monitrc
RUN echo "START=yes" > /etc/default/monit
RUN touch /var/lib/monit/state
RUN chmod 777 /var/lib/monit/state
RUN update-rc.d monit defaults add
WORKDIR ~/
ADD casinocoin casinocoin
RUN mv casinocoin /root/.casinocoin
RUN echo 'echo "rpcuser=`uuidgen`" >> ~/.casinocoin/casinocoin.conf' > /root/cherrypop
RUN echo 'echo "rpcpassword=`uuidgen`" >> ~/.casinocoin/casinocoin.conf' >> /root/cherrypop
RUN chmod 755 /root/cherrypop
RUN echo "/root/cherrypop" >> /etc/bash.bashrc
RUN echo "rm -f /root/cherrypop" >> /etc/bash.bashrc
RUN echo "/usr/bin/casinocoind -pid=/var/run/casinocoind.pid -datadir=/root/.casinocoin --daemon" >> /etc/bash.bashrc
RUN echo "/etc/init.d/monit start" >> /etc/bash.bashrc
RUN echo "sed -i '/cherrypop/d' /etc/bash.bashrc" >> /etc/bash.bashrc