-
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
2 changed files
with
6 additions
and
9 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 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,22 +1,18 @@ | ||
FROM rust:1.80 AS build | ||
|
||
WORKDIR /usr/src | ||
RUN apt-get update -y && \ | ||
apt-get install -y --no-install-recommends musl-tools && \ | ||
rustup target add x86_64-unknown-linux-musl | ||
FROM --platform=$BUILDPLATFORM rust:1.80-alpine AS build | ||
|
||
RUN apk add musl-dev --no-cache | ||
|
||
WORKDIR /usr/src | ||
RUN USER=root cargo new --bin vesta | ||
WORKDIR /usr/src/vesta | ||
COPY Cargo.toml Cargo.lock ./ | ||
COPY src ./src | ||
RUN cargo install --target x86_64-unknown-linux-musl --path . | ||
|
||
RUN cargo build --release | ||
|
||
FROM scratch | ||
|
||
WORKDIR /app | ||
COPY ./static static | ||
COPY --from=build /usr/src/vesta/target/x86_64-unknown-linux-musl/release/vesta . | ||
COPY --from=build /usr/src/vesta/target/release/vesta /app/vesta | ||
|
||
CMD ["/app/vesta"] |