Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

Commit 6bb3a42

Browse files
committed
Switched ethermint Docker building process to the one similar to Tendermint
1 parent 30941a1 commit 6bb3a42

File tree

1 file changed

+33
-22
lines changed

1 file changed

+33
-22
lines changed

ethermint/Dockerfile

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,47 @@
1-
FROM alpine:3.7
1+
# Build Ethermint
2+
FROM golang:1.9-alpine as builder
23

3-
ENV DATA_ROOT /ethermint
4-
# ENV TENDERMINT_ADDR tcp://0.0.0.0:46657
5-
6-
RUN addgroup emuser && \
7-
adduser -S -G emuser emuser
8-
9-
RUN mkdir -p $DATA_ROOT && \
10-
chown -R emuser:emuser $DATA_ROOT
11-
12-
RUN apk add --no-cache bash
4+
ENV EM_VERSION v0.5.4
135

14-
# Setting Golang paths
156
ENV GOPATH /go
167
ENV PATH "$PATH:/go/bin"
17-
# ENV ETHERMINT_VERSION develop
18-
# ENV ETHERMINT_VERSION master
19-
ENV ETHERMINT_VERSION v0.5.4
208

21-
# Installing Ethermint from source
9+
# Install dependencies
10+
RUN apk update && \
11+
apk add --no-cache make gcc musl-dev linux-headers go build-base git
12+
13+
# Install Golang's dependency manager
14+
RUN go-wrapper download -u github.com/Masterminds/glide && \
15+
go-wrapper install github.com/Masterminds/glide && \
16+
rm -rf /usr/lib/go /go/src /go/pkg /var/cache/*
17+
18+
# Get the source code
2219
RUN mkdir -p /go/src/github.com/tendermint/ethermint && \
23-
apk add --no-cache go build-base git linux-headers && \
2420
cd /go/src/github.com/tendermint/ethermint && \
2521
git clone https://github.com/tendermint/ethermint . && \
26-
git checkout ${ETHERMINT_VERSION} && \
27-
make get_vendor_deps && \
28-
make install && \
29-
glide cc && \
30-
cd - && \
22+
git checkout ${EM_VERSION}
23+
24+
# Build ethermint and all tools
25+
RUN cd /go/src/github.com/tendermint/ethermint && \
26+
make get_vendor_deps && make install && glide cc && cd - && \
3127
rm -rf /go/src/github.com/tendermint/ethermint && \
3228
apk del go build-base git
3329

30+
31+
# Pull all binaries into a second stage deploy alpine container
32+
FROM alpine:latest
33+
34+
# The /ethermint/data dir is used by ethermint to store state.
35+
ENV DATA_ROOT /ethermint
36+
#ENV TENDERMINT_ADDR tcp://0.0.0.0:46657
37+
38+
# Create directory for persistence and give our user ownership
39+
RUN mkdir -p $DATA_ROOT
40+
41+
RUN apk add --no-cache ca-certificates bash
42+
COPY --from=builder /go/bin/* /usr/local/bin/
43+
44+
# Expose the data directory as a volume since there's mutable state in there
3445
VOLUME $DATA_ROOT
3546

3647
EXPOSE 46658

0 commit comments

Comments
 (0)