Skip to content

Commit

Permalink
Adding Cargo Rust to the Python Environment (#11599)
Browse files Browse the repository at this point in the history
Co-authored-by: “Thavachelvam <“thavaahariharangit@git.com”>
  • Loading branch information
thavaahariharangit and “Thavachelvam authored Feb 17, 2025
1 parent 92370ad commit c38541c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,24 @@ COPY --from=python-3.13 $PYENV_ROOT/versions/ $PYENV_ROOT/versions/
COPY --from=python-3.13 /opt/python/ /opt/python/

RUN pyenv global $PY_3_13

USER root

# Install Rust
ENV RUSTUP_HOME=/opt/rust \
CARGO_HOME=/opt/rust \
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse \
PATH="${PATH}:/opt/rust/bin"
RUN mkdir -p "$RUSTUP_HOME" && chown dependabot:dependabot "$RUSTUP_HOME"

USER dependabot

COPY --from=rust /usr/local/rustup $RUSTUP_HOME
COPY --from=rust /usr/local/cargo $CARGO_HOME

# Configure cargo to use Git CLI so the Git shim works
RUN mkdir -p ~/.cargo && printf "[net]\ngit-fetch-with-cli = true\n" >> ~/.cargo/config.toml

COPY --chown=dependabot:dependabot cargo $DEPENDABOT_HOME/cargo
COPY --chown=dependabot:dependabot common $DEPENDABOT_HOME/common
COPY --chown=dependabot:dependabot updater $DEPENDABOT_HOME/dependabot-updater

0 comments on commit c38541c

Please sign in to comment.