ci(fix): dockerfile

This commit is contained in:
thek4n 2026-06-03 14:36:07 +03:00
parent 070953f477
commit 212e3abb86
3 changed files with 7 additions and 6 deletions

View File

@ -1,7 +1,6 @@
[package] [package]
name = "thek4n-ru" name = "thek4n-ru"
version = "0.1.0" version = "0.1.0"
edition = "2024"
authors = ["Vladislav Kan <thek4n@yandex.ru>"] authors = ["Vladislav Kan <thek4n@yandex.ru>"]
license = "MIT" license = "MIT"

View File

@ -20,9 +20,10 @@ FROM chef AS builder
COPY --from=chef /app/recipe.json /app/recipe.json COPY --from=chef /app/recipe.json /app/recipe.json
RUN cargo chef cook --target x86_64-unknown-linux-musl --release --recipe-path /app/recipe.json RUN cargo chef cook --target x86_64-unknown-linux-musl --release --recipe-path /app/recipe.json
## Если есть rust-toolchain.toml # rust-toolchain должен содержать
# COPY rust-toolchain.toml rust-toolchain.toml ## targets = ["x86_64-unknown-linux-musl"]
# RUN cargo fetch COPY rust-toolchain.toml* ./
RUN cargo fetch
COPY . . COPY . .
RUN cargo build --target x86_64-unknown-linux-musl --release RUN cargo build --target x86_64-unknown-linux-musl --release
@ -31,6 +32,6 @@ RUN cargo build --target x86_64-unknown-linux-musl --release
# Runtime # Runtime
FROM scratch FROM scratch
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/example /usr/local/bin/example COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/thek4n-ru /usr/local/bin/thek4n-ru
CMD ["/usr/local/bin/example"] CMD ["/usr/local/bin/thek4n-ru"]

View File

@ -1,3 +1,4 @@
[toolchain] [toolchain]
channel = "stable" channel = "stable"
components = ["clippy", "rustfmt"] components = ["clippy", "rustfmt"]
targets = ["x86_64-unknown-linux-musl"]