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]
name = "thek4n-ru"
version = "0.1.0"
edition = "2024"
authors = ["Vladislav Kan <thek4n@yandex.ru>"]
license = "MIT"

View File

@ -20,9 +20,10 @@ FROM chef AS builder
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
## Если есть rust-toolchain.toml
# COPY rust-toolchain.toml rust-toolchain.toml
# RUN cargo fetch
# rust-toolchain должен содержать
## targets = ["x86_64-unknown-linux-musl"]
COPY rust-toolchain.toml* ./
RUN cargo fetch
COPY . .
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
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]
channel = "stable"
components = ["clippy", "rustfmt"]
targets = ["x86_64-unknown-linux-musl"]