-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathDockerfile
More file actions
81 lines (60 loc) · 2.18 KB
/
Dockerfile
File metadata and controls
81 lines (60 loc) · 2.18 KB
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
81
# ------------------------------------------------------------------------------
# Build avalanche
# ------------------------------------------------------------------------------
FROM golang:1.24.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.24.9 AS rosetta
ARG ROS_COMMIT
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
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
ENV CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__"
RUN apt-get update -y && \
apt-get install -y --no-install-recommends build-essential && \
rm -rf /var/lib/apt/lists/*
RUN git checkout $ROS_COMMIT && \
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 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"]