You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 2.8 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
  2. MAINTAINER leonwanghui <leon.wanghui@huawei.com>
  3. # Set env
  4. ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5
  5. ENV OMPI_ROOT_PATH /usr/local/openmpi-4.0.3
  6. ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH
  7. ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH
  8. # Install base tools
  9. RUN apt update \
  10. && DEBIAN_FRONTEND=noninteractive apt install -y \
  11. vim \
  12. wget \
  13. curl \
  14. xz-utils \
  15. net-tools \
  16. openssh-client \
  17. git \
  18. ntpdate \
  19. tzdata \
  20. tcl \
  21. sudo \
  22. bash-completion
  23. # Install compile tools
  24. RUN DEBIAN_FRONTEND=noninteractive apt install -y \
  25. gcc \
  26. g++ \
  27. zlibc \
  28. make \
  29. libgmp-dev \
  30. patch \
  31. autoconf \
  32. libtool \
  33. automake \
  34. flex
  35. # Install the rest dependent tools
  36. RUN DEBIAN_FRONTEND=noninteractive apt install -y \
  37. libnuma-dev
  38. # Set bash
  39. RUN echo "dash dash/sh boolean false" | debconf-set-selections
  40. RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
  41. # Install python (v3.7.5)
  42. RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \
  43. libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \
  44. && cd /tmp \
  45. && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \
  46. && tar -xvf v3.7.5.tar.gz \
  47. && cd /tmp/cpython-3.7.5 \
  48. && mkdir -p ${PYTHON_ROOT_PATH} \
  49. && ./configure --prefix=${PYTHON_ROOT_PATH} \
  50. && make -j4 \
  51. && make install -j4 \
  52. && rm -f /usr/local/bin/python \
  53. && rm -f /usr/local/bin/pip \
  54. && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \
  55. && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \
  56. && rm -rf /tmp/cpython-3.7.5 \
  57. && rm -f /tmp/v3.7.5.tar.gz
  58. # Set pip source
  59. RUN mkdir -pv /root/.pip \
  60. && echo "[global]" > /root/.pip/pip.conf \
  61. && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \
  62. && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf
  63. # Install openmpi (v4.0.3)
  64. RUN cd /tmp \
  65. && wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz \
  66. && tar -xvf openmpi-4.0.3.tar.gz \
  67. && cd /tmp/openmpi-4.0.3 \
  68. && mkdir -p ${OMPI_ROOT_PATH} \
  69. && ./configure --prefix=${OMPI_ROOT_PATH} \
  70. && make -j4 \
  71. && make install -j4 \
  72. && rm -rf /tmp/openmpi-4.0.3 \
  73. && rm -f /tmp/openmpi-4.0.3.tar.gz
  74. # Install MindSpore cuda-10.1 whl package
  75. RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.0/MindSpore/gpu/ubuntu_x86/cuda-10.1/mindspore_gpu-1.2.0-cp37-cp37m-linux_x86_64.whl
  76. # Install MindInsight whl package
  77. RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.0/MindInsight/ascend/ubuntu_x86/mindinsight-1.2.0-cp37-cp37m-linux_x86_64.whl