forked from p2pderivatives/rust-dlc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (34 loc) · 1.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM rust as kcov-base
ENV WORKSPACE /app
WORKDIR ${WORKSPACE}
COPY "./scripts/install_kcov.sh" ./
ENV DEBIAN_FRONTEND=noninteractive
# install dependencies
RUN apt-get update && apt-get -y install wget binutils-dev libcurl4-openssl-dev\
libssl-dev libelf-dev zlib1g-dev libdw-dev libiberty-dev\
build-essential python3 cmake
# install kcov
RUN ./install_kcov.sh
FROM rust as planner
ENV WORKSPACE /app
WORKDIR ${WORKSPACE}
RUN cargo install cargo-chef
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM rust as cacher
ENV WORKSPACE /app
WORKDIR ${WORKSPACE}
RUN cargo install cargo-chef
COPY --from=planner ${WORKSPACE}/recipe.json recipe.json
RUN cargo chef cook --recipe-path recipe.json
FROM kcov-base as tester
ENV WORKSPACE /app
WORKDIR ${WORKSPACE}
COPY . .
# Copy over the cached dependencies
COPY --from=cacher /app/target target
COPY --from=cacher /usr/local/cargo /usr/local/cargo
RUN apt-get install -y linux-perf linux-base
RUN cargo test --no-run
RUN cp -r ./dlc-sled-storage-provider/test_files ./target/debug/deps/
CMD [ "cargo test" ]