-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathDockerfile.with-builder
More file actions
68 lines (53 loc) · 2.6 KB
/
Copy pathDockerfile.with-builder
File metadata and controls
68 lines (53 loc) · 2.6 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
# Fork image built against THIS repo's node (e.g. a PR build) instead of the
# released binary. Stage 1 compiles hydradx in bookworm so its glibc matches the
# node:18-bookworm runtime; scraper + relay binaries still come from releases.
# Build with the repo root as context:
# docker build -f launch-configs/fork/Dockerfile.with-builder -t galacticcouncil/fork:synth .
FROM rust:1.88-bookworm AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
clang libclang-dev protobuf-compiler cmake pkg-config libssl-dev git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY . .
ENV CXXFLAGS="-include cstdint"
RUN cargo build --release --locked --config net.git-fetch-with-cli=true -p hydradx
FROM node:18-bookworm
RUN apt-get update && apt-get install -y \
curl \
wget \
nodejs \
npm \
ca-certificates \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /zombienet/hydration-node/launch-configs/fork
RUN wget -q https://github.com/paritytech/zombienet/releases/download/v1.3.128/zombienet-linux-x64 -O /usr/local/bin/zombienet && \
chmod +x /usr/local/bin/zombienet
RUN zombienet version
ARG POLKADOT_SDK_VERSION=latest
RUN mkdir -p /zombienet/polkadot-sdk/target/release
RUN if [ "$POLKADOT_SDK_VERSION" = "latest" ]; then \
DOWNLOAD_URL="https://github.com/paritytech/polkadot-sdk/releases/latest/download"; \
else \
DOWNLOAD_URL="https://github.com/paritytech/polkadot-sdk/releases/download/$POLKADOT_SDK_VERSION"; \
fi && \
for binary in polkadot polkadot-execute-worker polkadot-prepare-worker; do \
wget -q $DOWNLOAD_URL/$binary \
-O /zombienet/polkadot-sdk/target/release/$binary \
&& chmod +x /zombienet/polkadot-sdk/target/release/$binary \
&& /zombienet/polkadot-sdk/target/release/$binary --version; \
done
ARG HYDRATION_BIN_URL=https://github.com/galacticcouncil/hydration-node/releases/latest/download
RUN mkdir -p /zombienet/hydration-node/target/release
# scraper is unchanged by this build, pull it from the latest release.
RUN wget -q $HYDRATION_BIN_URL/scraper -O /zombienet/hydration-node/target/release/scraper && \
chmod +x /zombienet/hydration-node/target/release/scraper
# hydradx comes from the local builder stage (this PR).
COPY --from=builder /build/target/release/hydradx /zombienet/hydration-node/target/release/hydradx
RUN chmod +x /zombienet/hydration-node/target/release/hydradx && \
/zombienet/hydration-node/target/release/hydradx --version
COPY launch-configs/fork/ .
RUN npm i
VOLUME /zombienet/hydration-node/launch-configs/fork/data
EXPOSE 9988
CMD npm start