FROM docker:20:10-dind as docker_host FROM debian:trixie ARG USERNAME=rustbuilder ARG USER_UID=1000 ARG USER_GID=$USER_UID ARG RUST_VERSION ARG NODE_VERSION ENV RUST_VERSION=${RUST_VERSION:-1.84} ENV NODE_VERSION=${NODE_VERSION:-22.11.0} 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 libpq-dev libsqlite3-dev && \ 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 ENV NVM_DIR=/home/${USERNAME}/.nvm RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} RUN rustup install $RUST_VERSION && \ rustup default $RUST_VERSION && \ rustup install nightly && \ cargo install cargo-binstall junitify cargo-nextest RUN cargo install cross --git https://github.com/cross-rs/cross COPY --from=docker_host /usr/local/bin/docker /usr/local/bin/docker ENV CROSS_CONTAINER_IN_CONTAINER=true ENV CROSS_CONTAINER_UID=${USER_UID} ENV CROSS_CONTAINER_GID=${USER_GID} ENV PATH="${PATH}:/home/${USERNAME}/.cargo/bin:${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/"