Newer
Older
Casey Kuhlman
committed
# Pull base image.
FROM eris/base
MAINTAINER Eris Industries <support@erisindustries.com>
#-----------------------------------------------------------------------------
# dependencies
#-----------------------------------------------------------------------------
# install tendermint
# set the repo and install tendermint -- should track vendored commit
ENV REPO_ALIAS github.com/tendermint/tendermint
ENV REPO github.com/eris-ltd/tendermint
# note, we want to lock in the same commit number
# as eris-db has vendored.
Casey Kuhlman
committed
RUN mkdir --parents $GOPATH/src/$REPO
RUN git clone --quiet https://$REPO . && \
go build -o /usr/local/bin/tendermint ./cmd/tendermint
Casey Kuhlman
committed
#-----------------------------------------------------------------------------
# install erisdb
Casey Kuhlman
committed
# set the repo and install erisdb
ENV REPO $GOPATH/src/github.com/eris-ltd/eris-db
COPY . $REPO
WORKDIR $REPO
RUN cd ./cmd/erisdb && go build -o /usr/local/bin/erisdb && \
Casey Kuhlman
committed
#-----------------------------------------------------------------------------
# install mint-client tools
Casey Kuhlman
committed
# set the repo and install mint-client
ENV REPO github.com/eris-ltd/mint-client
Casey Kuhlman
committed
RUN mkdir --parents $GOPATH/src/$REPO
WORKDIR $GOPATH/src/$REPO
RUN git clone --quiet https://$REPO . && \
git checkout --quiet $BRANCH && \
Casey Kuhlman
committed
go install ./... && \
mv $GOPATH/bin/mint* /usr/local/bin && \
mv ./mint-client /usr/local/bin/
#-----------------------------------------------------------------------------
Casey Kuhlman
committed
# cleanup
RUN rm -rf $GOPATH/src/* && \
unset REPO && \
unset BRANCH
Casey Kuhlman
committed
#-----------------------------------------------------------------------------
# start script
# install the wrapper/start script
COPY DOCKER/start.sh /usr/local/bin/erisdb-wrapper
#-----------------------------------------------------------------------------
# chain manager scripts and default mint config
RUN mkdir -p $ECM_PATH
COPY DOCKER/chain_* $ECM_PATH/
COPY DOCKER/config.toml $ECM_PATH/
COPY DOCKER/version.sh $ECM_PATH/
#-----------------------------------------------------------------------------
# permission the directories
RUN chown -R eris /usr/local/bin
RUN chown -R eris $ECM_PATH
#-----------------------------------------------------------------------------
# root dir
Casey Kuhlman
committed
# persist data, set user
VOLUME /home/$USER/.eris
WORKDIR /home/$USER/.eris
USER $USER
RUN mkdir --parents /home/$USER/.eris/blockchains/tendermint
ENV TMROOT /home/$USER/.eris/blockchains/tendermint
# run tendermint
# ports: 1337:eris-db API; 46656:mint-peer; 46657:mint-rpc
EXPOSE 1337
EXPOSE 46656
EXPOSE 46657
CMD "erisdb-wrapper"