From 0ac0d580b813d64c73231924f3eb6cd26ebdc4cd Mon Sep 17 00:00:00 2001 From: Muhamad Awad Date: Mon, 20 Jan 2025 10:59:01 +0100 Subject: [PATCH] Add `restatectl` and `restate` to the docker image --- docker/Dockerfile | 10 +++++++--- docker/debug.Dockerfile | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 741acecba..9db4996f4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,15 +36,17 @@ ENV SCCACHE_DIR=/var/cache/sccache # Should be set to 'false' or 'true'. See https://doc.rust-lang.org/cargo/reference/environment-variables.html ARG CARGO_PROFILE_RELEASE_DEBUG=false ARG RESTATE_FEATURES='' -RUN just arch=$TARGETARCH libc=gnu features=$RESTATE_FEATURES chef-cook --release --bin restate-server +RUN just arch=$TARGETARCH libc=gnu features=$RESTATE_FEATURES chef-cook --release --bins COPY . . # Mount the sccache directory as a cache to leverage sccache during build # Caching layer if nothing has changed # Use sccache during the main build RUN --mount=type=cache,target=/var/cache/sccache \ - just arch=$TARGETARCH libc=gnu features=$RESTATE_FEATURES build --release --bin restate-server && \ + just arch=$TARGETARCH libc=gnu features=$RESTATE_FEATURES build --release --bins && \ just notice-file && \ - mv target/$(just arch=$TARGETARCH libc=gnu print-target)/release/restate-server target/restate-server + mv target/$(just arch=$TARGETARCH libc=gnu print-target)/release/restate-server target/restate-server && \ + mv target/$(just arch=$TARGETARCH libc=gnu print-target)/release/restatectl target/restatectl && \ + mv target/$(just arch=$TARGETARCH libc=gnu print-target)/release/restate target/restate FROM builder AS upload-false @@ -64,5 +66,7 @@ COPY --from=builder /restate/LICENSE /LICENSE # copy OS roots COPY --from=builder /etc/ssl /etc/ssl COPY --from=upload /restate/target/restate-server /usr/local/bin +COPY --from=upload /restate/target/restatectl /usr/local/bin +COPY --from=upload /restate/target/restate /usr/local/bin WORKDIR / ENTRYPOINT ["/usr/local/bin/restate-server"] diff --git a/docker/debug.Dockerfile b/docker/debug.Dockerfile index 9250c554a..1293fdb1d 100644 --- a/docker/debug.Dockerfile +++ b/docker/debug.Dockerfile @@ -34,19 +34,23 @@ ENV SCCACHE_DIR=/var/cache/sccache # Should be set to 'false' or 'true'. See https://doc.rust-lang.org/cargo/reference/environment-variables.html ARG CARGO_PROFILE_RELEASE_DEBUG=false ARG RESTATE_FEATURES='' -RUN just arch=$TARGETARCH libc=gnu features=$RESTATE_FEATURES chef-cook --bin restate-server +RUN just arch=$TARGETARCH libc=gnu features=$RESTATE_FEATURES chef-cook --bins COPY . . # Mount the sccache directory as a cache to leverage sccache during build # Caching layer if nothing has changed # Use sccache during the main build RUN --mount=type=cache,target=/var/cache/sccache \ - just arch=$TARGETARCH libc=gnu features=$RESTATE_FEATURES build --bin restate-server && \ + just arch=$TARGETARCH libc=gnu features=$RESTATE_FEATURES build --bins && \ just notice-file && \ - mv target/$(just arch=$TARGETARCH libc=gnu print-target)/debug/restate-server target/restate-server + mv target/$(just arch=$TARGETARCH libc=gnu print-target)/debug/restate-server target/restate-server && \ + mv target/$(just arch=$TARGETARCH libc=gnu print-target)/debug/restatectl target/restatectl && \ + mv target/$(just arch=$TARGETARCH libc=gnu print-target)/debug/restate target/restate # We do not need the Rust toolchain to run the server binary! FROM debian:bookworm-slim AS runtime COPY --from=builder /restate/target/restate-server /usr/local/bin +COPY --from=builder /restate/target/restatectl /usr/local/bin +COPY --from=builder /restate/target/restate /usr/local/bin COPY --from=builder /restate/NOTICE /NOTICE COPY --from=builder /restate/LICENSE /LICENSE # copy OS roots