2018-04-10 03:39:47 -07:00
|
|
|
# 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
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 03:39:47 -07:00
|
|
|
FROM alpine:edge
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 09:48:47 -07:00
|
|
|
# Set up dependencies
|
2018-04-10 03:39:47 -07:00
|
|
|
ENV PACKAGES go glide make git libc-dev bash
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 03:39:47 -07:00
|
|
|
# Set up GOPATH & PATH
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 03:39:47 -07:00
|
|
|
ENV GOPATH /root/go
|
|
|
|
ENV BASE_PATH $GOPATH/src/github.com/cosmos
|
|
|
|
ENV REPO_PATH $BASE_PATH/cosmos-sdk
|
|
|
|
ENV WORKDIR /cosmos/
|
|
|
|
ENV PATH $GOPATH/bin:$PATH
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 03:39:47 -07:00
|
|
|
# Link expected Go repo path
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 09:48:47 -07:00
|
|
|
RUN mkdir -p $WORKDIR $GOPATH/pkg $ $GOPATH/bin $BASE_PATH
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 03:39:47 -07:00
|
|
|
# Add source files
|
|
|
|
|
2018-04-10 09:48:47 -07:00
|
|
|
ADD . $REPO_PATH
|
2018-04-10 03:39:47 -07:00
|
|
|
|
2018-04-10 09:48:47 -07:00
|
|
|
# Install minimum necessary dependencies, build Cosmos SDK, remove packages
|
|
|
|
RUN apk add --no-cache $PACKAGES && \
|
2018-05-03 21:13:23 -07:00
|
|
|
cd $REPO_PATH && make get_tools && make get_vendor_deps && make build && make install && \
|
2018-04-10 09:48:47 -07:00
|
|
|
apk del $PACKAGES
|
2018-04-10 03:39:47 -07:00
|
|
|
|
|
|
|
# Set entrypoint
|
|
|
|
|
2018-04-10 09:48:47 -07:00
|
|
|
ENTRYPOINT ["gaiad"]
|