Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

Seanaye/chore/standalone dockerfile (#3373)

Sean Aye4f4ccd28dd57
diff --git a/rust/cloud-storage/Dockerfile b/rust/cloud-storage/Dockerfile
index 9aa8f8e065..df177070d7 100644
--- a/rust/cloud-storage/Dockerfile
+++ b/rust/cloud-storage/Dockerfile
@@ -1,30 +1,21 @@
-# Set the cache image name
-ARG CACHE_IMAGE=569036502058.dkr.ecr.us-east-1.amazonaws.com/cloud-storage-cache:latest
-# Load the cache image
-FROM ${CACHE_IMAGE} AS cache
-
-ARG SERVICE_NAME
-ENV SQLX_OFFLINE=true
-
+# syntax=docker/dockerfile:1
FROM rust:latest AS chef
ARG SERVICE_NAME
ENV SQLX_OFFLINE=true
-RUN cargo install cargo-strip
WORKDIR /app
FROM chef AS builder
ARG SERVICE_NAME
-# COPY the pre-built dependencies from cache image
-COPY --from=cache /app/target target
-COPY --from=cache /usr/local/cargo /usr/local/cargo
-
COPY . .
# Build the service
-RUN cargo build --release --bin ${SERVICE_NAME} && \
- cargo strip && \
- mv /app/target/release/${SERVICE_NAME} /app/svc
+RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=shared \
+ --mount=type=cache,target=/usr/local/cargo/git/db,sharing=shared \
+ --mount=type=cache,target=/app/target,id=rust-target-release,sharing=locked \
+ cargo build --release --bin ${SERVICE_NAME} && \
+ strip /app/target/release/${SERVICE_NAME} && \
+ cp /app/target/release/${SERVICE_NAME} /app/svc
# Create slim runner to run the service
FROM debian:trixie-slim AS runner