Merge pull request #835 from cosmos/cwgoes/dockerify
Add basic Dockerfile to build all binaries and export gaiad
This commit is contained in:
commit
3581a4d079
|
@ -0,0 +1,5 @@
|
||||||
|
Dockerfile
|
||||||
|
Vagrantfile
|
||||||
|
|
||||||
|
build/
|
||||||
|
coverage.txt
|
46
Dockerfile
46
Dockerfile
|
@ -1,28 +1,34 @@
|
||||||
FROM alpine:3.5
|
# Simple usage with a mounted data directory:
|
||||||
|
# > docker build -t gaia .
|
||||||
|
# > docker run -v $HOME/.gaiad:/root/.gaiad gaia init
|
||||||
|
# > docker run -v $HOME/.gaiad:/root/.gaiad gaia start
|
||||||
|
|
||||||
# BCHOME is where your genesis.json, key.json and other files including state are stored.
|
FROM alpine:edge
|
||||||
ENV BCHOME /basecoin
|
|
||||||
|
|
||||||
# Create a basecoin user and group first so the IDs get set the same way, even
|
# Set up dependencies
|
||||||
# as the rest of this may change over time.
|
ENV PACKAGES go glide make git libc-dev bash
|
||||||
RUN addgroup basecoin && \
|
|
||||||
adduser -S -G basecoin basecoin
|
|
||||||
|
|
||||||
RUN mkdir -p $BCHOME && \
|
# Set up GOPATH & PATH
|
||||||
chown -R basecoin:basecoin $BCHOME
|
|
||||||
WORKDIR $BCHOME
|
|
||||||
|
|
||||||
# Expose the basecoin home directory as a volume since there's mutable state in there.
|
ENV GOPATH /root/go
|
||||||
VOLUME $BCHOME
|
ENV BASE_PATH $GOPATH/src/github.com/cosmos
|
||||||
|
ENV REPO_PATH $BASE_PATH/cosmos-sdk
|
||||||
|
ENV WORKDIR /cosmos/
|
||||||
|
ENV PATH $GOPATH/bin:$PATH
|
||||||
|
|
||||||
# jq and curl used for extracting `pub_key` from private validator while
|
# Link expected Go repo path
|
||||||
# deploying tendermint with Kubernetes. It is nice to have bash so the users
|
|
||||||
# could execute bash commands.
|
|
||||||
RUN apk add --no-cache bash curl jq
|
|
||||||
|
|
||||||
COPY basecoin /usr/bin/basecoin
|
RUN mkdir -p $WORKDIR $GOPATH/pkg $ $GOPATH/bin $BASE_PATH
|
||||||
|
|
||||||
ENTRYPOINT ["basecoin"]
|
# Add source files
|
||||||
|
|
||||||
# By default you will get the basecoin with local MerkleEyes and in-proc Tendermint.
|
ADD . $REPO_PATH
|
||||||
CMD ["start", "--dir=${BCHOME}"]
|
|
||||||
|
# Install minimum necessary dependencies, build Cosmos SDK, remove packages
|
||||||
|
RUN apk add --no-cache $PACKAGES && \
|
||||||
|
cd $REPO_PATH && make get_tools && make get_vendor_deps && make all && make install && \
|
||||||
|
apk del $PACKAGES
|
||||||
|
|
||||||
|
# Set entrypoint
|
||||||
|
|
||||||
|
ENTRYPOINT ["gaiad"]
|
||||||
|
|
Loading…
Reference in New Issue