Dockerfile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # To build: $ sudo docker build -t myimage:1.0 .
  2. # To run: $ sudo docker run --rm -it --gpus=all -p 8888:8888 myimage:1.0
  3. # To run Jupyter inside the container: $ jupyter notebook --ip 0.0.0.0 --port 8888 --no-browser --allow-root
  4. FROM nvcr.io/nvidia/cuda:10.2-base-ubuntu18.04
  5. RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && \
  6. DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y && \
  7. DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
  8. openssh-server m4 vim-nox emacs-nox nano zip wget python3 python3-pip python3-setuptools git-core inotify-tools curl git-lfs build-essential && \
  9. rm -rf /var/lib/apt/cache/*
  10. RUN pip3 install --upgrade pip
  11. RUN apt-get install --no-install-recommends -y openssh-client
  12. RUN pip3 install jupyter
  13. RUN pip3 install netcdf4
  14. ### NVIDIA HPC SDK 20.7
  15. RUN wget https://developer.download.nvidia.com/hpc-sdk/nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz
  16. RUN tar xpzf nvhpc_2020_207_Linux_x86_64_cuda_multi.tar.gz
  17. RUN nvhpc_2020_207_Linux_x86_64_cuda_multi/install
  18. ###
  19. RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
  20. bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/anaconda3 && \
  21. rm Miniconda3-latest-Linux-x86_64.sh && \
  22. /opt/anaconda3/bin/conda install -y -q netcdf4
  23. ENV PATH="$PATH:/opt/pgi/linux86-64/19.10/bin:/usr/local/bin:/opt/anaconda3/bin:/usr/bin" \
  24. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib" CPATH="$CPATH:/usr/local/include"
  25. ENV NVARCH=`uname -s`_`uname -m`; export NVARCH \
  26. NVCOMPILERS=/opt/nvidia/hpc_sdk; export NVCOMPILERS \
  27. MANPATH=$MANPATH:$NVCOMPILERS/$NVARCH/20.7/compilers/man; export MANPATH
  28. ENV PATH=$NVCOMPILERS/$NVARCH/20.7/compilers/bin:$PATH; export PATH \
  29. PATH=$NVCOMPILERS/$NVARCH/20.7/comm_libs/mpi/bin:$PATH \
  30. MANPATH=$MANPATH:$NVCOMPILERS/$NVARCH/20.7/comm_libs/mpi/man
  31. ADD English/ /labs