-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from codecrafters-io/rust1.77
CC-1120: Rust 1.77 upgrade
- Loading branch information
Showing
4 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM rust:1.77-buster | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y git=1:2.* && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY Cargo.toml /app/Cargo.toml | ||
COPY Cargo.lock /app/Cargo.lock | ||
|
||
RUN mkdir /app/src | ||
RUN echo 'fn main() { println!("Hello World!"); }' > /app/src/main.rs | ||
|
||
WORKDIR /app | ||
RUN cargo build --release --target-dir=/tmp/codecrafters-git-target | ||
|
||
RUN rm /tmp/codecrafters-git-target/release/git-starter-rust | ||
RUN rm /tmp/codecrafters-git-target/release/git-starter-rust.d | ||
|
||
RUN find /tmp/codecrafters-git-target/release -type f -maxdepth 1 -delete | ||
RUN rm -f /tmp/codecrafters-git-target/release/deps/*git_starter_rust* | ||
RUN rm -f /tmp/codecrafters-git-target/release/deps/git_starter_rust* | ||
RUN rm -f /tmp/codecrafters-git-target/release/.fingerprint/*git_starter_rust* | ||
RUN rm -f /tmp/codecrafters-git-target/release/.fingerprint/git_starter_rust* | ||
|
||
RUN rm -rf /app/src | ||
|
||
RUN echo "cd \${CODECRAFTERS_SUBMISSION_DIR} && cargo build --release --target-dir=/tmp/codecrafters-git-target --manifest-path Cargo.toml" > /codecrafters-precompile.sh | ||
RUN chmod +x /codecrafters-precompile.sh | ||
|
||
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Cargo.toml,Cargo.lock" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters