File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,12 @@ COPY .cargo .cargo
3232COPY bin bin
3333COPY crates crates
3434
35- # Build the release binary
36- RUN cargo build --release --features=reduced-circuits --bin mosaic \
37- && strip --strip-debug target/release/mosaic
35+ # Build both release binaries so runtime can switch via env var.
36+ RUN cargo build --release --bin mosaic \
37+ && cp target/release/mosaic target/release/mosaic-default \
38+ && cargo build --release --features=reduced-circuits --bin mosaic \
39+ && mv target/release/mosaic target/release/mosaic-reduced \
40+ && strip --strip-debug target/release/mosaic-default target/release/mosaic-reduced
3841
3942# ------------------------------------------------------------------------------
4043# Stage 2: Minimal runtime image
@@ -62,7 +65,8 @@ RUN FDB_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "amd64") \
6265# FDB cluster file – path configured via storage.cluster_file in config.toml
6366RUN mkdir -p /etc/mosaic && chown ubuntu:ubuntu /etc/mosaic
6467
65- COPY --from=builder /build/target/release/mosaic /usr/local/bin/mosaic
68+ COPY --from=builder /build/target/release/mosaic-default /usr/local/bin/mosaic
69+ COPY --from=builder /build/target/release/mosaic-reduced /usr/local/bin/mosaic-reduced
6670COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
6771RUN chmod +x /usr/local/bin/entrypoint.sh
6872
Original file line number Diff line number Diff line change 88# The config file's [circuit] section should reference:
99# path = "/etc/mosaic/circuit.v5c"
1010#
11+ # Set MOSAIC_REDUCED_CIRCUITS=1 to run the reduced-circuits build.
12+ #
1113# Any extra arguments are forwarded to the mosaic binary.
1214
1315set -euo pipefail
@@ -20,4 +22,12 @@ if [ ! -f "$CONFIG_PATH" ]; then
2022 exit 1
2123fi
2224
23- exec /usr/local/bin/mosaic " $CONFIG_PATH " " $@ "
25+ MOSAIC_BIN=" /usr/local/bin/mosaic"
26+
27+ case " ${MOSAIC_REDUCED_CIRCUITS:- } " in
28+ 1|true|TRUE|yes|YES|on|ON)
29+ MOSAIC_BIN=" /usr/local/bin/mosaic-reduced"
30+ ;;
31+ esac
32+
33+ exec " $MOSAIC_BIN " " $CONFIG_PATH " " $@ "
You can’t perform that action at this time.
0 commit comments