Skip to content

Commit

Permalink
mkdir the app/target
Browse files Browse the repository at this point in the history
  • Loading branch information
codingkarthik committed Jan 28, 2025
1 parent a153eec commit 845ee5f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ RUN cargo chef prepare --recipe-path recipe.json
# Caching stage
FROM chef AS cacher
COPY --from=planner /app/recipe.json recipe.json
RUN --mount=type=cache,target=/usr/local/cargo/registry \
RUN mkdir -p /app/target && \
--mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo chef cook --release --recipe-path recipe.json

# Final Rust build stage
FROM chef AS builder
COPY . .
RUN mkdir -p target
COPY --from=cacher /app/target target
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
Expand All @@ -35,11 +37,11 @@ WORKDIR /calcite-rs-jni
# Install required packages
RUN apt-get update && apt-get install -y \
maven \
gradle \
python3 \
python3-venv \
python3-pip \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*

# Copy project files
Expand All @@ -55,6 +57,9 @@ COPY calcite-rs-jni/build.sh ./

# Make build script executable and run it with DOCKER_BUILD flag
RUN chmod +x build.sh && \
chmod +x calcite/gradlew
RUN --mount=type=cache,target=/root/.gradle \
--mount=type=cache,target=/root/.m2 \
DOCKER_BUILD=1 ./build.sh

# Runtime stage
Expand Down

0 comments on commit 845ee5f

Please sign in to comment.