FROM nvidia/cuda:10.2-base-ubuntu18.04 # Install some basic utilities RUN apt update && apt install -y \ curl \ ca-certificates \ sudo \ git \ bzip2 \ libx11-6 \ && apt autoclean && apt autoremove \ && rm -rf /var/lib/apt/lists /var/cache/apt/archives # Create a working directory RUN mkdir /app WORKDIR /app # Create a non-root user and switch to it RUN adduser --disabled-password --gecos '' --shell /bin/bash user \ && chown -R user:user /app RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user USER user # All users can use /home/user as their home directory ENV HOME=/home/user RUN chmod 777 /home/user # Install Miniconda and Pytorch with Python #ENV CONDA_AUTO_UPDATE_CONDA=false ENV PATH=/home/user/miniconda/bin:$PATH RUN curl -sLo ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \ && chmod +x ~/miniconda.sh \ && ~/miniconda.sh -b -p ~/miniconda \ && rm ~/miniconda.sh \ && conda install -y -c pytorch pytorch \ && conda clean -ya