2018-04-10 03:39:47 -07:00
|
|
|
# Simple usage with a mounted data directory:
|
|
|
|
# > docker build -t gaia .
|
2018-07-02 21:13:31 -07:00
|
|
|
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli gaia gaiad init
|
|
|
|
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli gaia gaiad start
|
|
|
|
FROM golang:alpine AS build-env
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 09:48:47 -07:00
|
|
|
# Set up dependencies
|
2018-07-02 21:13:31 -07:00
|
|
|
ENV PACKAGES make git libc-dev bash gcc linux-headers eudev-dev
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-07-02 21:13:31 -07:00
|
|
|
# Set working directory for the build
|
|
|
|
WORKDIR /go/src/github.com/cosmos/cosmos-sdk
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-04-10 03:39:47 -07:00
|
|
|
# Add source files
|
2018-07-02 21:13:31 -07:00
|
|
|
COPY . .
|
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-12-20 10:03:59 -08:00
|
|
|
make tools && \
|
2019-01-22 18:08:39 -08:00
|
|
|
make vendor-deps && \
|
2018-07-02 21:13:31 -07:00
|
|
|
make build && \
|
|
|
|
make install
|
|
|
|
|
|
|
|
# Final image
|
|
|
|
FROM alpine:edge
|
|
|
|
|
|
|
|
# Install ca-certificates
|
|
|
|
RUN apk add --update ca-certificates
|
|
|
|
WORKDIR /root
|
2018-04-10 03:39:47 -07:00
|
|
|
|
2018-07-02 21:13:31 -07:00
|
|
|
# Copy over binaries from the build-env
|
|
|
|
COPY --from=build-env /go/bin/gaiad /usr/bin/gaiad
|
|
|
|
COPY --from=build-env /go/bin/gaiacli /usr/bin/gaiacli
|
2018-04-10 03:39:47 -07:00
|
|
|
|
2018-07-02 21:13:31 -07:00
|
|
|
# Run gaiad by default, omit entrypoint to ease using container with gaiacli
|
|
|
|
CMD ["gaiad"]
|