@@ -7,13 +7,14 @@ WORKDIR /app
77COPY contracts/ ./contracts/
88COPY eth2near/ ./eth2near/
99
10- # Build the project with cache mounts
10+ # Build the project and copy binaries out of cache mount
1111WORKDIR /app/eth2near
12- ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
1312RUN --mount=type=cache,target=/app/eth2near/target \
1413 --mount=type=cache,target=/usr/local/cargo/registry \
15- --mount=type=cache,target=/usr/local/cargo/git,id=git-cache-v2 \
16- cargo build --release
14+ --mount=type=cache,target=/usr/local/cargo/git \
15+ cargo build --release && \
16+ cp target/release/eth2-contract-init /tmp/ && \
17+ cp target/release/eth2_to_near_relay /tmp/
1718
1819# === RUNTIME STAGE ===
1920FROM debian:bookworm-slim AS runtime
@@ -26,9 +27,9 @@ RUN apt-get update && apt-get install -y \
2627
2728WORKDIR /app
2829
29- # Copy built binaries from builder stage
30- COPY --from=builder /app/eth2near/target/release /eth2-contract-init /usr/local/bin/
31- COPY --from=builder /app/eth2near/target/release /eth2_to_near_relay /usr/local/bin/
30+ # Copy built binaries from temp location
31+ COPY --from=builder /tmp /eth2-contract-init /usr/local/bin/
32+ COPY --from=builder /tmp /eth2_to_near_relay /usr/local/bin/
3233
3334# Create non-root user for security
3435RUN useradd -m -u 1001 appuser
0 commit comments