-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
20 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "spot" | ||
name = "rustyspot" | ||
version = "0.2.0" | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
FROM lukemathwalker/cargo-chef:latest-rust-bookworm AS chef | ||
WORKDIR /app | ||
FROM alpine AS chmodder | ||
ARG FEATURE | ||
ARG TARGETARCH | ||
ARG COMPONENT | ||
COPY /artifacts/binaries-$TARGETARCH$FEATURE/$COMPONENT /app/$COMPONENT | ||
RUN chmod +x /app/* | ||
|
||
FROM chef AS planner | ||
COPY . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
FROM chef AS builder | ||
COPY --from=planner /app/recipe.json recipe.json | ||
# Build dependencies - this is the caching Docker layer! | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
# Build application | ||
COPY . . | ||
RUN cargo build --release --bin spot | ||
|
||
FROM gcr.io/distroless/cc-debian12 AS runtime | ||
COPY --from=builder /app/target/release/spot /usr/local/bin/ | ||
ENTRYPOINT ["/usr/local/bin/spot"] | ||
FROM gcr.io/distroless/cc-debian12 | ||
ARG COMPONENT | ||
COPY --from=chmodder /app/$COMPONENT /usr/local/bin/spot | ||
ENTRYPOINT [ "/usr/local/bin/spot" ] |