This commit is contained in:
Elijah McMorris 2023-06-30 00:57:27 +00:00
parent 41bd1e8fe7
commit ffb24e7943
Signed by: NexVeridian
SSH key fingerprint: SHA256:bsA1SKZxuEcEVHAy3gY1HUeM5ykRJl0U0kQHQn0hMg8
6 changed files with 93 additions and 81 deletions

View file

@ -1,15 +1,29 @@
FROM rust:latest AS builder
FROM rust:bookworm AS builder
RUN rustup target add x86_64-unknown-linux-musl && apt update && apt install -y musl-tools musl-dev
RUN apt-get update && \
apt install -y musl-tools musl-dev libssl-dev clang mold
# RUN curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
RUN curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C /usr/local/bin
# RUN cargo install cargo-nextest --locked
WORKDIR /ark-invest-api-rust-data
COPY . .
RUN rustup target add x86_64-unknown-linux-musl && rustup update && cargo update
RUN --mount=type=cache,target=/usr/local/cargo,from=rust,source=/usr/local/cargo \
--mount=type=cache,target=./target \
cargo build --target x86_64-unknown-linux-musl --release && \
cp ./target/x86_64-unknown-linux-musl/release/ark-invest-api-rust-data .
cp ./target/target/x86_64-unknown-linux-musl/release/ark-invest-api-rust-data .
FROM builder AS test
RUN --mount=type=cache,target=/usr/local/cargo,from=rust,source=/usr/local/cargo \
--mount=type=cache,target=./target \
cargo nextest run --release --target x86_64-unknown-linux-musl \
-E "all() - test(get_api) - kind(bin)"
FROM alpine:latest