add dockerfile
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
FROM rust:1.87-slim AS builder
|
FROM rust:1.94-bookworm AS builder
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
@@ -7,12 +7,10 @@ RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/li
|
|||||||
# Copy workspace manifests
|
# Copy workspace manifests
|
||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
|
||||||
# Copy only the crates needed for klog-backend
|
# Copy workspace member manifests
|
||||||
COPY crates/ktracing/Cargo.toml crates/ktracing/Cargo.toml
|
COPY backend/Cargo.toml backend/Cargo.toml
|
||||||
COPY crates/ktracing-subscriber/Cargo.toml crates/ktracing-subscriber/Cargo.toml
|
COPY types/Cargo.toml types/Cargo.toml
|
||||||
COPY klog/backend/Cargo.toml klog/backend/Cargo.toml
|
COPY cli/Cargo.toml cli/Cargo.toml
|
||||||
COPY klog/klog-cli/Cargo.toml klog/klog-cli/Cargo.toml
|
|
||||||
COPY klog/types/Cargo.toml klog/types/Cargo.toml
|
|
||||||
|
|
||||||
# Stub out every workspace member so Cargo can resolve the graph without full source
|
# Stub out every workspace member so Cargo can resolve the graph without full source
|
||||||
RUN find . -name "Cargo.toml" -not -path "./Cargo.toml" | while read f; do \
|
RUN find . -name "Cargo.toml" -not -path "./Cargo.toml" | while read f; do \
|
||||||
@@ -26,14 +24,11 @@ RUN find . -name "Cargo.toml" -not -path "./Cargo.toml" | while read f; do \
|
|||||||
RUN cargo build --release -p klog-backend 2>/dev/null || true
|
RUN cargo build --release -p klog-backend 2>/dev/null || true
|
||||||
|
|
||||||
# Now copy real source
|
# Now copy real source
|
||||||
COPY crates/ktracing/src crates/ktracing/src
|
COPY backend/src backend/src
|
||||||
COPY crates/ktracing-subscriber/src crates/ktracing-subscriber/src
|
COPY types/src types/src
|
||||||
COPY klog/backend/src klog/backend/src
|
|
||||||
COPY klog/types/src klog/types/src
|
|
||||||
|
|
||||||
# Touch to invalidate cached stubs
|
# Touch to invalidate cached stubs
|
||||||
RUN find klog/backend/src klog/types/src crates/ktracing/src crates/ktracing-subscriber/src \
|
RUN find backend/src types/src -name "*.rs" -exec touch {} +
|
||||||
-name "*.rs" -exec touch {} +
|
|
||||||
|
|
||||||
RUN cargo build --release -p klog-backend
|
RUN cargo build --release -p klog-backend
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user