Skip to content
Snippets Groups Projects
Verified Commit 6e95d5a6 authored by Louis's avatar Louis :fire:
Browse files

Specify rust version by ARG, use non-root user, install binstall and nextest commands

parent c193f27b
No related branches found
No related tags found
No related merge requests found
FROM debian:trixie
ENV CARGO_HOME="$HOME/.cargo"
ARG USERNAME=rustbuilder
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN apt update && \
apt install curl wget zip unzip rustup && \
ARG RUST_VERSION=1.82
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
RUN apt-get update && \
apt-get install -y sudo curl wget zip unzip make build-essential clang rustup && \
rm -rf /var/lib/apt/lists/*
RUN rustup install stable -y && \
rustup default stable -y && \
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME
USER $USERNAME
RUN rustup install $RUST_VERSION && \
rustup default $RUST_VERSION && \
rustup install nightly && \
cargo install junitify
\ No newline at end of file
cargo install cargo-binstall junitify cargo-nextest
ENV PATH=$PATH:/home/$USERNAME/.cargo/bin
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment