create a truly static binary and a scratch run container #3
12
Dockerfile
12
Dockerfile
@ -1,9 +1,15 @@
|
|||||||
FROM rust:1.75.0
|
FROM rust:1.75.0 as builder
|
||||||
|
|
||||||
WORKDIR /usr/src/chaospott-status
|
WORKDIR /usr/src/chaospott-status
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN cargo install --path .
|
|
||||||
|
# use musl to create a truly static binary https://bxbrenden.github.io/
|
||||||
|
RUN rustup component add rust-std-x86_64-unknown-linux-musl
|
||||||
|
RUN cargo build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=builder /usr/src/chaospott-status/target/x86_64-unknown-linux-musl/release/chaospott-status /chaospott-status
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD ["chaospott-status"]
|
CMD ["/chaospott-status"]
|
Loading…
Reference in New Issue
Block a user