-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (29 loc) · 1005 Bytes
/
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
FROM rust:1.66.1
WORKDIR /
# Copy workspace cargo files
COPY Cargo.* ./
# Create workspace member directories
RUN mkdir -p common/src model/src model/benches printer/src qa/src simulator/src solver/src solver/benches
# Copy workspace member cargo files
COPY common/Cargo.* common
COPY model/Cargo.* model
COPY printer/Cargo.* printer
COPY qa/Cargo.* qa
COPY simulator/Cargo.* simulator
COPY solver/Cargo.* solver
# Create workspace member dummy main files
RUN echo 'fn main() {}' > common/src/main.rs
RUN echo 'fn main() {}' > model/src/main.rs
RUN touch model/benches/benchmarks.rs
RUN echo 'fn main() {}' > printer/src/main.rs
RUN echo 'fn main() {}' > qa/src/main.rs
RUN echo 'fn main() {}' > simulator/src/main.rs
RUN echo 'fn main() {}' > solver/src/main.rs
RUN touch solver/benches/benchmarks.rs
# Build once to cache dependencies
RUN cargo build --release -p solver
# Copy real sources
COPY . .
# Build final binary
RUN cargo build --release -p solver
ENTRYPOINT ["/target/release/solver"]