forked from ava-labs/avalanche-rosetta
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
80 lines (59 loc) · 2.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# ------------------------------------------------------------------------------
# Build avalanche
# ------------------------------------------------------------------------------
FROM golang:1.17.9 AS avalanche
ARG AVALANCHE_VERSION
RUN git clone https://github.com/ava-labs/avalanchego.git \
/go/src/github.com/ava-labs/avalanchego
WORKDIR /go/src/github.com/ava-labs/avalanchego
RUN git checkout $AVALANCHE_VERSION && \
./scripts/build.sh
# ------------------------------------------------------------------------------
# Build avalanche rosetta
# ------------------------------------------------------------------------------
FROM golang:1.17.9 AS rosetta
ARG ROSETTA_VERSION
RUN git clone https://github.com/ava-labs/avalanche-rosetta.git \
/go/src/github.com/ava-labs/avalanche-rosetta
WORKDIR /go/src/github.com/ava-labs/avalanche-rosetta
ENV CGO_ENABLED=1
ENV GOARCH=amd64
ENV GOOS=linux
RUN git checkout $ROSETTA_VERSION && \
go mod download
RUN \
GO_VERSION=$(go version | awk {'print $3'}) \
GIT_COMMIT=$(git rev-parse HEAD) \
make build
# ------------------------------------------------------------------------------
# Target container for running the node and rosetta server
# ------------------------------------------------------------------------------
FROM ubuntu:20.04
# Install dependencies
RUN apt-get update -y && \
apt-get install -y wget
WORKDIR /app
# Install avalanche daemon
COPY --from=avalanche \
/go/src/github.com/ava-labs/avalanchego/build/avalanchego \
/app/avalanchego
# Install evm plugin
COPY --from=avalanche \
/go/src/github.com/ava-labs/avalanchego/build/plugins/evm \
/app/plugins/evm
# Install rosetta server
COPY --from=rosetta \
/go/src/github.com/ava-labs/avalanche-rosetta/rosetta-server \
/app/rosetta-server
# Install rosetta runner
COPY --from=rosetta \
/go/src/github.com/ava-labs/avalanche-rosetta/rosetta-runner \
/app/rosetta-runner
# Install service start script
COPY --from=rosetta \
/go/src/github.com/ava-labs/avalanche-rosetta/docker/entrypoint.sh \
/app/entrypoint.sh
EXPOSE 9650
EXPOSE 9651
EXPOSE 8080
ENTRYPOINT ["/app/entrypoint.sh"]