From 4586dda134fe22800c9e0225c5035309006295b6 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Wed, 6 Mar 2024 14:22:17 +0530 Subject: [PATCH] Rust 1.76 upgrade --- dockerfiles/rust-1.76.Dockerfile | 25 +++++++++++++++++++++++++ starter_templates/codecrafters.yml | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 dockerfiles/rust-1.76.Dockerfile diff --git a/dockerfiles/rust-1.76.Dockerfile b/dockerfiles/rust-1.76.Dockerfile new file mode 100644 index 0000000..2b9a65e --- /dev/null +++ b/dockerfiles/rust-1.76.Dockerfile @@ -0,0 +1,25 @@ +FROM rust:1.76-buster + +# Download docker-explorer +ARG docker_explorer_version=v18 +RUN curl --fail -Lo /usr/local/bin/docker-explorer https://github.com/codecrafters-io/docker-explorer/releases/download/${docker_explorer_version}/${docker_explorer_version}_linux_amd64 +RUN chmod +x /usr/local/bin/docker-explorer + +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-docker-target + +RUN cargo clean -p docker-starter-rust --release --target-dir=/tmp/codecrafters-docker-target + +RUN rm -rf /app/src + +RUN echo "cd \${CODECRAFTERS_SUBMISSION_DIR} && cargo build --release --target-dir=/tmp/codecrafters-docker-target --manifest-path Cargo.toml" > /codecrafters-precompile.sh +RUN chmod +x /codecrafters-precompile.sh + +ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Cargo.toml,Cargo.lock" + diff --git a/starter_templates/codecrafters.yml b/starter_templates/codecrafters.yml index 35b8f71..4db5f8b 100644 --- a/starter_templates/codecrafters.yml +++ b/starter_templates/codecrafters.yml @@ -36,8 +36,8 @@ language_pack: c-9.2 language_pack: ruby-3.2 {{/ language_is_ruby }} {{# language_is_rust }} -# Available versions: rust-1.70 -language_pack: rust-1.70 +# Available versions: rust-1.76 +language_pack: rust-1.76 {{/ language_is_rust }} {{# language_is_haskell }} # Available versions: haskell-9.0