File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 1+ # syntax=docker/dockerfile:1.7-labs
12FROM rust:1.77-buster
23
3- COPY Cargo.toml /app/Cargo.toml
4- COPY Cargo.lock /app/Cargo.lock
4+ WORKDIR /app
55
6- RUN mkdir /app/src
7- RUN echo 'fn main() { println!("Hello World!"); }' > /app/src/main.rs
6+ # .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
7+ COPY --exclude=.git --exclude=README.md . /app
88
9- WORKDIR /app
109RUN cargo build --release --target-dir=/tmp/codecrafters-http-server-target
11-
1210RUN cargo clean -p http-server-starter-rust --release --target-dir=/tmp/codecrafters-http-server-target
1311
14- RUN rm -rf /app/src
15-
1612RUN echo "cd \$ {CODECRAFTERS_SUBMISSION_DIR} && cargo build --release --target-dir=/tmp/codecrafters-http-server-target --manifest-path Cargo.toml" > /codecrafters-precompile.sh
1713RUN chmod +x /codecrafters-precompile.sh
1814
1915ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Cargo.toml,Cargo.lock"
2016
17+ # Once the heavy steps are done, we can copy all files back
18+ COPY . /app
You can’t perform that action at this time.
0 commit comments