Skip to content

Commit 651f79d

Browse files
authored
Make clockworklabs/spacetime docker image build from source (#2521)
1 parent 483a948 commit 651f79d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# Use a base image that supports multi-arch
2+
FROM rust:bookworm AS builder
3+
4+
WORKDIR /usr/src/app
5+
COPY . .
6+
7+
RUN cargo build -p spacetimedb-standalone -p spacetimedb-cli --release --locked
8+
29
FROM rust:bookworm
310

411
# Install dependencies
@@ -30,14 +37,14 @@ RUN dotnet workload install wasi-experimental
3037
# Install Rust WASM target
3138
RUN rustup target add wasm32-unknown-unknown
3239

40+
# Copy over SpacetimeDB
41+
COPY --from=builder --chmod=755 /usr/src/app/target/release/spacetimedb-standalone /usr/src/app/target/release/spacetimedb-cli /opt/spacetime/
42+
RUN ln -s /opt/spacetime/spacetimedb-cli /usr/local/bin/spacetime
43+
3344
# Create and switch to a non-root user
3445
RUN useradd -m spacetime
3546
USER spacetime
3647

37-
# Install SpacetimeDB
38-
RUN curl -sSfL https://install.spacetimedb.com | bash -s -- --yes
39-
ENV PATH="/home/spacetime/.local/bin:${PATH}"
40-
4148
# Set working directory
4249
WORKDIR /app
4350

0 commit comments

Comments
 (0)