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 03:39:47 -07:00
|
|
|
# Install minimum necessary dependencies
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 03:39:47 -07:00
|
|
|
ENV PACKAGES go glide make git libc-dev bash
|
|
|
|
RUN apk add --no-cache $PACKAGES
|
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 03:39:47 -07:00
|
|
|
RUN mkdir -p $WORKDIR $GOPATH/pkg $ $GOPATH/bin $BASE_PATH && ln -sf $WORKDIR $REPO_PATH
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 03:39:47 -07:00
|
|
|
# Add source files
|
|
|
|
|
|
|
|
ADD . $WORKDIR
|
|
|
|
|
|
|
|
# Build cosmos-sdk
|
|
|
|
|
|
|
|
RUN cd $REPO_PATH && make get_tools && make get_vendor_deps && make all && make install
|
|
|
|
|
|
|
|
# Remove packages
|
|
|
|
|
|
|
|
RUN apk del $PACKAGES
|
|
|
|
|
|
|
|
# Set entrypoint
|
|
|
|
|
|
|
|
ENTRYPOINT ["/root/go/bin/gaiad"]
|