fix: docker build out-of-disk issue - aggressive cleanup
CI / CI (pull_request) Successful in 11m39s
CI / CI (pull_request) Successful in 11m39s
- .dockerignore: exclude build/cache/docs to reduce build context (59 lines) - Dockerfile: add aggressive cleanup (cache, registry, git) after cargo build - Dockerfile: use --locked flag for reproducible builds - build.yaml: add pre-build disk cleanup (docker + cargo cache) - build.yaml: clean cargo before Docker build to free space - build.yaml: show disk usage before/after for debugging Fixes 'No space left on device' error during Docker build in runner
This commit is contained in:
+13
-4
@@ -5,14 +5,23 @@ FROM rust:1-bookworm as builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Build settings
|
||||
ENV SQLX_OFFLINE=true
|
||||
|
||||
# Copy source
|
||||
COPY . .
|
||||
|
||||
# Build the mem binary (offline sqlx - uses .sqlx/ cache)
|
||||
ENV SQLX_OFFLINE=true
|
||||
RUN cargo build --release -p mem-cli && \
|
||||
# Build release binary with space-efficient cleanup
|
||||
RUN cargo build --release -p mem-cli --locked && \
|
||||
strip target/release/mem && \
|
||||
rm -rf target/release/deps target/release/build target/release/incremental target/release/.fingerprint
|
||||
# Aggressive cleanup to free disk space
|
||||
rm -rf target/release/deps && \
|
||||
rm -rf target/release/build && \
|
||||
rm -rf target/release/incremental && \
|
||||
rm -rf target/release/.fingerprint && \
|
||||
rm -rf .cargo/registry/cache && \
|
||||
rm -rf .cargo/registry/index && \
|
||||
rm -rf .cargo/git
|
||||
|
||||
# Stage 2: Runtime
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
Reference in New Issue
Block a user