Dockerfile-conda 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. FROM nvidia/cuda:10.2-base-ubuntu18.04
  2. # Install some basic utilities
  3. RUN apt update && apt install -y \
  4. curl \
  5. ca-certificates \
  6. sudo \
  7. git \
  8. bzip2 \
  9. libx11-6 \
  10. && apt autoclean && apt autoremove \
  11. && rm -rf /var/lib/apt/lists /var/cache/apt/archives
  12. # Create a working directory
  13. RUN mkdir /app
  14. WORKDIR /app
  15. # Create a non-root user and switch to it
  16. RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
  17. && chown -R user:user /app
  18. RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
  19. USER user
  20. # All users can use /home/user as their home directory
  21. ENV HOME=/home/user
  22. RUN chmod 777 /home/user
  23. # Install Miniconda and Pytorch with Python
  24. #ENV CONDA_AUTO_UPDATE_CONDA=false
  25. ENV PATH=/home/user/miniconda/bin:$PATH
  26. RUN curl -sLo ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
  27. && chmod +x ~/miniconda.sh \
  28. && ~/miniconda.sh -b -p ~/miniconda \
  29. && rm ~/miniconda.sh \
  30. && conda install -y -c pytorch pytorch \
  31. && conda clean -ya