Skip to content
Snippets Groups Projects
Dockerfile 721 B
Newer Older
Louis's avatar
Louis committed
FROM debian:trixie

ARG USERNAME=rustbuilder
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG RUST_VERSION=1.82

RUN groupadd --gid $USER_GID $USERNAME \
    && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME

RUN apt-get update && \
Louis's avatar
Louis committed
    apt-get install -y sudo curl wget zip unzip make build-essential clang rustup libpq-dev libsqlite3-dev && \
Louis's avatar
Louis committed
    rm -rf /var/lib/apt/lists/*

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 && \
Louis's avatar
Louis committed
    rustup install nightly && \
    cargo install cargo-binstall junitify cargo-nextest

ENV PATH=$PATH:/home/$USERNAME/.cargo/bin