ci(fix): dockerfile
This commit is contained in:
parent
070953f477
commit
212e3abb86
@ -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"
|
||||||
|
|
||||||
|
|||||||
11
Dockerfile
11
Dockerfile
@ -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"]
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "stable"
|
channel = "stable"
|
||||||
components = ["clippy", "rustfmt"]
|
components = ["clippy", "rustfmt"]
|
||||||
|
targets = ["x86_64-unknown-linux-musl"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user