|
1 | | -FROM rust:1.88-bookworm AS rust-builder |
| 1 | +# syntax=docker/dockerfile:1.7 |
2 | 2 |
|
3 | | -RUN apt-get update && apt-get install -y \ |
4 | | - cmake \ |
5 | | - clang \ |
6 | | - libclang-dev \ |
7 | | - protobuf-compiler \ |
8 | | - git \ |
9 | | - && rm -rf /var/lib/apt/lists/* |
| 3 | +FROM golang:1.24-bookworm AS orchestrator-builder |
10 | 4 |
|
11 | | -WORKDIR /build |
12 | | -COPY . . |
| 5 | +ENV CGO_ENABLED=0 |
| 6 | +WORKDIR /src |
13 | 7 |
|
14 | | -RUN cd engines/lighthouse/lighthouse && git submodule update --init --recursive |
| 8 | +COPY go.mod go.sum ./ |
| 9 | +RUN --mount=type=cache,target=/go/pkg/mod \ |
| 10 | + go mod download |
15 | 11 |
|
16 | | -WORKDIR /build/engines/lighthouse/lighthouse |
| 12 | +COPY . . |
| 13 | +ARG VERSION=dev |
| 14 | +RUN --mount=type=cache,target=/go/pkg/mod \ |
| 15 | + --mount=type=cache,target=/root/.cache/go-build \ |
| 16 | + go build -trimpath -ldflags="-s -w -X main.version=${VERSION}" \ |
| 17 | + -o /out/fcr-orchestrator ./cmd/fcr-orchestrator |
| 18 | + |
| 19 | + |
| 20 | +FROM rust:1.88-bookworm AS lighthouse-builder |
| 21 | + |
| 22 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 23 | + bash \ |
| 24 | + ca-certificates \ |
| 25 | + clang \ |
| 26 | + cmake \ |
| 27 | + git \ |
| 28 | + libclang-dev \ |
| 29 | + pkg-config \ |
| 30 | + protobuf-compiler \ |
| 31 | + && rm -rf /var/lib/apt/lists/* |
17 | 32 |
|
18 | | -RUN CARGO_NET_GIT_FETCH_WITH_CLI=true \ |
19 | | - cargo build -p fcr-simulator --features fake_crypto --release |
| 33 | +WORKDIR /src |
| 34 | +COPY . . |
| 35 | +RUN cd /tmp \ |
| 36 | + && git config --file /root/.gitconfig url."https://github.com/".insteadOf "git@github.com:" \ |
| 37 | + && git config --file /root/.gitconfig url."https://github.com/".insteadOf "ssh://git@github.com/" |
| 38 | +RUN if [ ! -f engines/lighthouse/lighthouse/Cargo.toml ]; then \ |
| 39 | + git submodule update --init --recursive engines/lighthouse/lighthouse; \ |
| 40 | + fi |
| 41 | +RUN --mount=type=cache,target=/usr/local/cargo/registry \ |
| 42 | + --mount=type=cache,target=/usr/local/cargo/git \ |
| 43 | + --mount=type=cache,target=/src/engines/lighthouse/lighthouse/target \ |
| 44 | + bash engines/lighthouse/build.sh |
20 | 45 |
|
21 | 46 |
|
22 | 47 | FROM eclipse-temurin:21-jdk-noble AS teku-builder |
23 | 48 |
|
24 | | -RUN apt-get update && apt-get install -y git bash && rm -rf /var/lib/apt/lists/* |
| 49 | +ARG FCR_TEKU_COMMIT=c5825d53325cd67ab91b35cc544a7b660be317ff |
25 | 50 |
|
26 | | -WORKDIR /build |
27 | | -COPY . . |
| 51 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 52 | + bash \ |
| 53 | + ca-certificates \ |
| 54 | + git \ |
| 55 | + && rm -rf /var/lib/apt/lists/* |
28 | 56 |
|
29 | | -RUN git -c protocol.file.allow=always submodule update --init --recursive engines/teku/teku |
30 | | -RUN bash engines/teku/build.sh |
| 57 | +ENV GRADLE_USER_HOME=/root/.gradle |
| 58 | +WORKDIR /src |
| 59 | +COPY . . |
| 60 | +RUN cd /tmp \ |
| 61 | + && git config --file /root/.gitconfig url."https://github.com/".insteadOf "git@github.com:" \ |
| 62 | + && git config --file /root/.gitconfig url."https://github.com/".insteadOf "ssh://git@github.com/" |
| 63 | +RUN if [ -f engines/teku/teku/settings.gradle ] \ |
| 64 | + && ! git -C engines/teku/teku rev-parse --is-inside-work-tree >/dev/null 2>&1; then \ |
| 65 | + rm -rf engines/teku/teku; \ |
| 66 | + mkdir -p engines/teku/teku; \ |
| 67 | + git -C engines/teku/teku init; \ |
| 68 | + git -C engines/teku/teku remote add origin https://github.com/Nashatyrev/teku.git; \ |
| 69 | + git -C engines/teku/teku fetch --depth 1 origin "${FCR_TEKU_COMMIT}"; \ |
| 70 | + git -C engines/teku/teku checkout --detach FETCH_HEAD; \ |
| 71 | + elif [ ! -f engines/teku/teku/settings.gradle ]; then \ |
| 72 | + git submodule update --init --recursive engines/teku/teku; \ |
| 73 | + fi |
| 74 | +RUN --mount=type=cache,target=/root/.gradle \ |
| 75 | + bash engines/teku/build.sh |
| 76 | + |
| 77 | + |
| 78 | +FROM node:24-bookworm-slim AS lodestar-builder |
| 79 | + |
| 80 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 81 | + bash \ |
| 82 | + ca-certificates \ |
| 83 | + git \ |
| 84 | + make \ |
| 85 | + python3 \ |
| 86 | + && rm -rf /var/lib/apt/lists/* |
31 | 87 |
|
| 88 | +ENV PNPM_HOME=/pnpm |
| 89 | +ENV PATH=/pnpm:${PATH} |
| 90 | +WORKDIR /src |
| 91 | +COPY . . |
| 92 | +ARG FCR_LODESTAR_COMMIT |
| 93 | +ARG FCR_LODESTAR_DESCRIBE |
| 94 | +ENV FCR_LODESTAR_COMMIT=${FCR_LODESTAR_COMMIT} |
| 95 | +ENV FCR_LODESTAR_DESCRIBE=${FCR_LODESTAR_DESCRIBE} |
| 96 | +RUN corepack enable && corepack prepare pnpm@10 --activate |
| 97 | +RUN cd /tmp \ |
| 98 | + && git config --file /root/.gitconfig url."https://github.com/".insteadOf "git@github.com:" \ |
| 99 | + && git config --file /root/.gitconfig url."https://github.com/".insteadOf "ssh://git@github.com/" |
| 100 | +RUN if [ ! -f engines/lodestar/lodestar/package.json ]; then \ |
| 101 | + git submodule update --init --recursive engines/lodestar/lodestar; \ |
| 102 | + fi |
| 103 | +RUN --mount=type=cache,target=/pnpm/store \ |
| 104 | + pnpm config set store-dir /pnpm/store \ |
| 105 | + && bash engines/lodestar/build.sh |
| 106 | + |
| 107 | + |
| 108 | +FROM debian:bookworm AS nimbus-builder |
| 109 | + |
| 110 | +ARG FCR_NIMBUS_COMMIT=6fb05f36804d53c2e8e014cfeeea8ad7996a5efe |
| 111 | + |
| 112 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 113 | + bash \ |
| 114 | + build-essential \ |
| 115 | + ca-certificates \ |
| 116 | + cmake \ |
| 117 | + curl \ |
| 118 | + file \ |
| 119 | + git \ |
| 120 | + git-lfs \ |
| 121 | + pkg-config \ |
| 122 | + && rm -rf /var/lib/apt/lists/* |
32 | 123 |
|
33 | | -FROM golang:1.24-bookworm AS go-builder |
| 124 | +WORKDIR /src |
| 125 | +COPY . . |
| 126 | +RUN cd /tmp \ |
| 127 | + && git config --file /root/.gitconfig url."https://github.com/".insteadOf "git@github.com:" \ |
| 128 | + && git config --file /root/.gitconfig url."https://github.com/".insteadOf "ssh://git@github.com/" |
| 129 | +RUN if [ -f engines/nimbus/nimbus-eth2/Makefile ] \ |
| 130 | + && ! git -C engines/nimbus/nimbus-eth2 rev-parse --is-inside-work-tree >/dev/null 2>&1; then \ |
| 131 | + rm -rf engines/nimbus/nimbus-eth2; \ |
| 132 | + mkdir -p engines/nimbus/nimbus-eth2; \ |
| 133 | + git -C engines/nimbus/nimbus-eth2 init; \ |
| 134 | + git -C engines/nimbus/nimbus-eth2 remote add origin https://github.com/status-im/nimbus-eth2.git; \ |
| 135 | + git -C engines/nimbus/nimbus-eth2 fetch --depth 1 origin "${FCR_NIMBUS_COMMIT}"; \ |
| 136 | + git -C engines/nimbus/nimbus-eth2 checkout --detach FETCH_HEAD; \ |
| 137 | + elif [ ! -f engines/nimbus/nimbus-eth2/Makefile ]; then \ |
| 138 | + git submodule update --init --recursive engines/nimbus/nimbus-eth2; \ |
| 139 | + fi |
| 140 | +RUN bash engines/nimbus/build.sh |
| 141 | + |
| 142 | + |
| 143 | +FROM rust:1.88-bookworm AS grandine-builder |
| 144 | + |
| 145 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 146 | + bash \ |
| 147 | + ca-certificates \ |
| 148 | + clang \ |
| 149 | + cmake \ |
| 150 | + git \ |
| 151 | + libclang-dev \ |
| 152 | + pkg-config \ |
| 153 | + protobuf-compiler \ |
| 154 | + && rm -rf /var/lib/apt/lists/* |
34 | 155 |
|
35 | | -WORKDIR /build |
| 156 | +WORKDIR /src |
36 | 157 | COPY . . |
| 158 | +RUN --mount=type=cache,target=/usr/local/cargo/registry \ |
| 159 | + --mount=type=cache,target=/usr/local/cargo/git \ |
| 160 | + bash engines/grandine/build.sh |
37 | 161 |
|
38 | | -RUN go build -o /out/fcr-orchestrator ./cmd/fcr-orchestrator |
39 | 162 |
|
| 163 | +FROM debian:bookworm-slim AS orchestrator |
40 | 164 |
|
41 | | -FROM eclipse-temurin:21-jre-noble |
| 165 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 166 | + ca-certificates \ |
| 167 | + && rm -rf /var/lib/apt/lists/* |
| 168 | + |
| 169 | +COPY --from=orchestrator-builder /out/fcr-orchestrator /usr/local/bin/fcr-orchestrator |
| 170 | +ENTRYPOINT ["fcr-orchestrator"] |
42 | 171 |
|
43 | | -RUN apt-get update && \ |
44 | | - apt-get install -y ca-certificates && \ |
45 | | - rm -rf /var/lib/apt/lists/* |
46 | 172 |
|
47 | | -COPY --from=rust-builder /build/engines/lighthouse/lighthouse/target/release/fcr-lighthouse /usr/local/bin/fcr-lighthouse |
48 | | -COPY --from=teku-builder /build/engines/teku/.build/dist/fcr-teku-all.jar /usr/local/lib/fcr-teku-all.jar |
49 | | -COPY --from=go-builder /out/fcr-orchestrator /usr/local/bin/fcr-orchestrator |
| 173 | +FROM debian:bookworm-slim AS lighthouse |
50 | 174 |
|
51 | | -RUN printf '#!/usr/bin/env sh\nexec java -jar /usr/local/lib/fcr-teku-all.jar "$@"\n' > /usr/local/bin/fcr-teku && \ |
52 | | - chmod +x /usr/local/bin/fcr-teku |
| 175 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 176 | + ca-certificates \ |
| 177 | + libgcc-s1 \ |
| 178 | + && rm -rf /var/lib/apt/lists/* |
53 | 179 |
|
| 180 | +COPY --from=orchestrator-builder /out/fcr-orchestrator /usr/local/bin/fcr-orchestrator |
| 181 | +COPY --from=lighthouse-builder /src/results/fcr-lighthouse /usr/local/bin/fcr-lighthouse |
54 | 182 | ENV FCR_ENGINE_BINARY=/usr/local/bin/fcr-lighthouse |
55 | 183 | ENTRYPOINT ["fcr-orchestrator"] |
| 184 | + |
| 185 | + |
| 186 | +FROM eclipse-temurin:21-jre-noble AS teku |
| 187 | + |
| 188 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 189 | + ca-certificates \ |
| 190 | + && rm -rf /var/lib/apt/lists/* |
| 191 | + |
| 192 | +COPY --from=orchestrator-builder /out/fcr-orchestrator /usr/local/bin/fcr-orchestrator |
| 193 | +COPY --from=teku-builder /src/engines/teku/.build/dist/fcr-teku-all.jar /usr/local/lib/fcr-teku/fcr-teku-all.jar |
| 194 | +RUN printf '%s\n' \ |
| 195 | + '#!/usr/bin/env sh' \ |
| 196 | + 'exec java -jar /usr/local/lib/fcr-teku/fcr-teku-all.jar "$@"' \ |
| 197 | + > /usr/local/bin/fcr-teku \ |
| 198 | + && chmod +x /usr/local/bin/fcr-teku |
| 199 | +ENV FCR_ENGINE_BINARY=/usr/local/bin/fcr-teku |
| 200 | +ENTRYPOINT ["fcr-orchestrator"] |
| 201 | + |
| 202 | + |
| 203 | +FROM node:24-bookworm-slim AS lodestar |
| 204 | + |
| 205 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 206 | + ca-certificates \ |
| 207 | + && rm -rf /var/lib/apt/lists/* |
| 208 | + |
| 209 | +COPY --from=orchestrator-builder /out/fcr-orchestrator /usr/local/bin/fcr-orchestrator |
| 210 | +COPY --from=lodestar-builder /src/engines/lodestar /opt/fcr/lodestar |
| 211 | +RUN printf '%s\n' \ |
| 212 | + '#!/usr/bin/env sh' \ |
| 213 | + 'exec node --enable-source-maps --max-old-space-size="${FCR_LODESTAR_MAX_OLD_SPACE_SIZE:-12288}" /opt/fcr/lodestar/dist/main.mjs "$@"' \ |
| 214 | + > /usr/local/bin/fcr-lodestar \ |
| 215 | + && chmod +x /usr/local/bin/fcr-lodestar |
| 216 | +ENV FCR_ENGINE_BINARY=/usr/local/bin/fcr-lodestar |
| 217 | +ENTRYPOINT ["fcr-orchestrator"] |
| 218 | + |
| 219 | + |
| 220 | +FROM debian:bookworm-slim AS nimbus |
| 221 | + |
| 222 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 223 | + ca-certificates \ |
| 224 | + && rm -rf /var/lib/apt/lists/* |
| 225 | + |
| 226 | +COPY --from=orchestrator-builder /out/fcr-orchestrator /usr/local/bin/fcr-orchestrator |
| 227 | +COPY --from=nimbus-builder /src/results/fcr-nimbus /usr/local/bin/fcr-nimbus |
| 228 | +ENV FCR_ENGINE_BINARY=/usr/local/bin/fcr-nimbus |
| 229 | +ENTRYPOINT ["fcr-orchestrator"] |
| 230 | + |
| 231 | + |
| 232 | +FROM debian:bookworm-slim AS grandine |
| 233 | + |
| 234 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 235 | + ca-certificates \ |
| 236 | + libgcc-s1 \ |
| 237 | + && rm -rf /var/lib/apt/lists/* |
| 238 | + |
| 239 | +COPY --from=orchestrator-builder /out/fcr-orchestrator /usr/local/bin/fcr-orchestrator |
| 240 | +COPY --from=grandine-builder /src/results/fcr-grandine /usr/local/bin/fcr-grandine |
| 241 | +ENV FCR_ENGINE_BINARY=/usr/local/bin/fcr-grandine |
| 242 | +ENTRYPOINT ["fcr-orchestrator"] |
0 commit comments