From 0043f44f0c0a9b7de3983c3656075645e79c2eff Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Tue, 1 Apr 2025 19:38:25 +0000 Subject: [PATCH] chore: build edge binaries in release mode --- packages/edge/infra/client/container-runner/Dockerfile | 2 +- packages/edge/infra/client/isolate-v8-runner/Dockerfile | 4 ++-- packages/edge/infra/client/manager/Dockerfile | 4 ++-- packages/edge/infra/edge-server/Dockerfile | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/edge/infra/client/container-runner/Dockerfile b/packages/edge/infra/client/container-runner/Dockerfile index 1660d78583..c176f4775b 100644 --- a/packages/edge/infra/client/container-runner/Dockerfile +++ b/packages/edge/infra/client/container-runner/Dockerfile @@ -7,7 +7,7 @@ RUN \ --mount=type=cache,target=/root/.cargo/git \ --mount=type=cache,target=/root/.cargo/registry \ --mount=type=cache,target=/app/target \ - RUSTFLAGS="--cfg tokio_unstable" cargo build --release --bin rivet-container-runner && \ + RUSTFLAGS="--cfg tokio_unstable" cargo build --bin rivet-container-runner --release && \ mkdir -p /app/dist && \ mv /app/target/x86_64-unknown-linux-musl/release/rivet-container-runner /app/dist/rivet-container-runner diff --git a/packages/edge/infra/client/isolate-v8-runner/Dockerfile b/packages/edge/infra/client/isolate-v8-runner/Dockerfile index 1cbd5d5a24..de380b1edc 100644 --- a/packages/edge/infra/client/isolate-v8-runner/Dockerfile +++ b/packages/edge/infra/client/isolate-v8-runner/Dockerfile @@ -17,9 +17,9 @@ RUN \ --mount=type=cache,target=/root/.cargo/git \ --mount=type=cache,target=/root/.cargo/registry \ --mount=type=cache,target=/app/target \ - RUSTFLAGS="--cfg tokio_unstable" cargo build --target x86_64-unknown-linux-gnu --bin rivet-isolate-v8-runner && \ + RUSTFLAGS="--cfg tokio_unstable" cargo build --target x86_64-unknown-linux-gnu --bin rivet-isolate-v8-runner --release && \ mkdir -p /app/dist && \ - mv /app/target/x86_64-unknown-linux-gnu/debug/rivet-isolate-v8-runner /app/dist/rivet-isolate-v8-runner + mv /app/target/x86_64-unknown-linux-gnu/release/rivet-isolate-v8-runner /app/dist/rivet-isolate-v8-runner # Create an empty image and copy binaries into it to minimize the size of the image FROM scratch diff --git a/packages/edge/infra/client/manager/Dockerfile b/packages/edge/infra/client/manager/Dockerfile index be1281876d..16a2179ab8 100644 --- a/packages/edge/infra/client/manager/Dockerfile +++ b/packages/edge/infra/client/manager/Dockerfile @@ -17,9 +17,9 @@ RUN \ --mount=type=cache,target=/root/.cargo/git \ --mount=type=cache,target=/root/.cargo/registry \ --mount=type=cache,target=/app/target \ - RUSTFLAGS="--cfg tokio_unstable" cargo build --target x86_64-unknown-linux-gnu --bin rivet-client && \ + RUSTFLAGS="--cfg tokio_unstable" cargo build --target x86_64-unknown-linux-gnu --bin rivet-client --release && \ mkdir -p /app/dist && \ - mv /app/target/x86_64-unknown-linux-gnu/debug/rivet-client /app/dist/rivet-client + mv /app/target/x86_64-unknown-linux-gnu/release/rivet-client /app/dist/rivet-client # Create an empty image and copy binaries into it to minimize the size of the image FROM scratch diff --git a/packages/edge/infra/edge-server/Dockerfile b/packages/edge/infra/edge-server/Dockerfile index 6e97adba0e..5a5d350a64 100644 --- a/packages/edge/infra/edge-server/Dockerfile +++ b/packages/edge/infra/edge-server/Dockerfile @@ -18,9 +18,9 @@ RUN \ --mount=type=cache,target=/root/.cargo/registry \ --mount=type=cache,target=/app/target \ # TODO: release is too slow - RUSTFLAGS="--cfg tokio_unstable" cargo build --target x86_64-unknown-linux-gnu --bin rivet-edge-server && \ + RUSTFLAGS="--cfg tokio_unstable" cargo build --target x86_64-unknown-linux-gnu --bin rivet-edge-server --release && \ mkdir -p /app/dist && \ - mv /app/target/x86_64-unknown-linux-gnu/debug/rivet-edge-server /app/dist/rivet-edge-server + mv /app/target/x86_64-unknown-linux-gnu/release/rivet-edge-server /app/dist/rivet-edge-server # Create an empty image and copy binaries into it to minimize the size of the image FROM scratch