feat: align release workflow with rivet, add crate metadata, docker support

This commit is contained in:
Nathan Flurry 2026-01-27 19:22:59 -08:00
parent a28a44280a
commit 016d529c67
9 changed files with 237 additions and 67 deletions

51
docker/runtime/Dockerfile Normal file
View file

@ -0,0 +1,51 @@
# syntax=docker/dockerfile:1.10.0
# Build stage - compile the binary
FROM rust:1.88.0 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
musl-tools \
musl-dev \
pkg-config \
ca-certificates \
git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN rustup target add x86_64-unknown-linux-musl
WORKDIR /build
COPY . .
# Build static binary
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/build/target \
SANDBOX_AGENT_SKIP_INSPECTOR=1 \
RUSTFLAGS="-C target-feature=+crt-static" \
cargo build -p sandbox-agent --release --target x86_64-unknown-linux-musl && \
cp target/x86_64-unknown-linux-musl/release/sandbox-agent /sandbox-agent
# Runtime stage - minimal image
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
git && \
rm -rf /var/lib/apt/lists/*
# Copy the binary from builder
COPY --from=builder /sandbox-agent /usr/local/bin/sandbox-agent
RUN chmod +x /usr/local/bin/sandbox-agent
# Create non-root user
RUN useradd -m -s /bin/bash sandbox
USER sandbox
WORKDIR /home/sandbox
EXPOSE 2468
ENTRYPOINT ["sandbox-agent"]
CMD ["--host", "0.0.0.0", "--port", "2468"]