2018-07-12 23:22:19 +00:00
|
|
|
FROM golang:alpine AS build-env
|
|
|
|
|
|
|
|
# Set up dependencies
|
2020-03-18 12:43:02 +00:00
|
|
|
ENV PACKAGES git build-base
|
2018-07-12 23:22:19 +00:00
|
|
|
|
|
|
|
# Set working directory for the build
|
2020-10-09 15:52:32 +00:00
|
|
|
WORKDIR /go/src/github.com/cosmos/ethermint
|
2018-07-12 23:22:19 +00:00
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
RUN apk add --update $PACKAGES
|
2020-08-10 20:10:33 +00:00
|
|
|
RUN apk add linux-headers
|
2018-07-12 23:22:19 +00:00
|
|
|
|
|
|
|
# Add source files
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Make the binary
|
2020-03-18 12:43:02 +00:00
|
|
|
RUN make build
|
2018-07-12 23:22:19 +00:00
|
|
|
|
|
|
|
# Final image
|
2018-11-27 18:31:39 +00:00
|
|
|
FROM alpine
|
2018-07-12 23:22:19 +00:00
|
|
|
|
|
|
|
# Install ca-certificates
|
2020-11-24 21:36:46 +00:00
|
|
|
RUN apk add --update ca-certificates jq
|
2018-07-12 23:22:19 +00:00
|
|
|
WORKDIR /root
|
|
|
|
|
2020-09-08 22:25:16 +00:00
|
|
|
# Copy over binaries from the build-env
|
2020-10-09 15:52:32 +00:00
|
|
|
COPY --from=build-env /go/src/github.com/cosmos/ethermint/build/ethermintd /usr/bin/ethermintd
|
2018-07-12 23:22:19 +00:00
|
|
|
|
2020-08-05 15:17:50 +00:00
|
|
|
# Run ethermintd by default
|
|
|
|
CMD ["ethermintd"]
|