|
1 |
| -FROM alpine:3.5 |
| 1 | +# Simple usage with a mounted data directory: |
| 2 | +# > docker build -t gaia . |
| 3 | +# > docker run -v $HOME/.gaiad:/root/.gaiad gaia init |
| 4 | +# > docker run -v $HOME/.gaiad:/root/.gaiad gaia start |
2 | 5 |
|
3 |
| -# BCHOME is where your genesis.json, key.json and other files including state are stored. |
4 |
| -ENV BCHOME /basecoin |
| 6 | +FROM alpine:edge |
5 | 7 |
|
6 |
| -# Create a basecoin user and group first so the IDs get set the same way, even |
7 |
| -# as the rest of this may change over time. |
8 |
| -RUN addgroup basecoin && \ |
9 |
| - adduser -S -G basecoin basecoin |
| 8 | +# Install minimum necessary dependencies |
10 | 9 |
|
11 |
| -RUN mkdir -p $BCHOME && \ |
12 |
| - chown -R basecoin:basecoin $BCHOME |
13 |
| -WORKDIR $BCHOME |
| 10 | +ENV PACKAGES go glide make git libc-dev bash |
| 11 | +RUN apk add --no-cache $PACKAGES |
14 | 12 |
|
15 |
| -# Expose the basecoin home directory as a volume since there's mutable state in there. |
16 |
| -VOLUME $BCHOME |
| 13 | +# Set up GOPATH & PATH |
17 | 14 |
|
18 |
| -# jq and curl used for extracting `pub_key` from private validator while |
19 |
| -# deploying tendermint with Kubernetes. It is nice to have bash so the users |
20 |
| -# could execute bash commands. |
21 |
| -RUN apk add --no-cache bash curl jq |
| 15 | +ENV GOPATH /root/go |
| 16 | +ENV BASE_PATH $GOPATH/src/github.com/cosmos |
| 17 | +ENV REPO_PATH $BASE_PATH/cosmos-sdk |
| 18 | +ENV WORKDIR /cosmos/ |
| 19 | +ENV PATH $GOPATH/bin:$PATH |
22 | 20 |
|
23 |
| -COPY basecoin /usr/bin/basecoin |
| 21 | +# Link expected Go repo path |
24 | 22 |
|
25 |
| -ENTRYPOINT ["basecoin"] |
| 23 | +RUN mkdir -p $WORKDIR $GOPATH/pkg $ $GOPATH/bin $BASE_PATH && ln -sf $WORKDIR $REPO_PATH |
26 | 24 |
|
27 |
| -# By default you will get the basecoin with local MerkleEyes and in-proc Tendermint. |
28 |
| -CMD ["start", "--dir=${BCHOME}"] |
| 25 | +# Add source files |
| 26 | + |
| 27 | +ADD . $WORKDIR |
| 28 | + |
| 29 | +# Build cosmos-sdk |
| 30 | + |
| 31 | +RUN cd $REPO_PATH && make get_tools && make get_vendor_deps && make all && make install |
| 32 | + |
| 33 | +# Remove packages |
| 34 | + |
| 35 | +RUN apk del $PACKAGES |
| 36 | + |
| 37 | +# Set entrypoint |
| 38 | + |
| 39 | +ENTRYPOINT ["/root/go/bin/gaiad"] |
0 commit comments