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.5 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. FROM nvidia/cuda:9.2-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 CMAKE_ROOT_PATH /usr/local/cmake-3.14.1
  6. ENV PATH ${PYTHON_ROOT_PATH}/bin:${CMAKE_ROOT_PATH}/bin:/usr/local/bin:$PATH
  7. # Install base tools
  8. RUN apt update \
  9. && DEBIAN_FRONTEND=noninteractive apt install -y \
  10. vim \
  11. wget \
  12. curl \
  13. xz-utils \
  14. net-tools \
  15. openssh-client \
  16. git \
  17. ntpdate \
  18. tzdata \
  19. tcl \
  20. sudo \
  21. bash-completion
  22. # Install compile tools
  23. RUN DEBIAN_FRONTEND=noninteractive apt install -y \
  24. gcc \
  25. g++ \
  26. zlibc \
  27. make \
  28. libgmp-dev \
  29. patch \
  30. autoconf \
  31. libtool \
  32. automake \
  33. flex
  34. # Set bash
  35. RUN echo "dash dash/sh boolean false" | debconf-set-selections
  36. RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
  37. # Install python (v3.7.5)
  38. RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \
  39. libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \
  40. && cd /tmp \
  41. && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \
  42. && tar -xvf v3.7.5.tar.gz \
  43. && cd /tmp/cpython-3.7.5 \
  44. && mkdir -p ${PYTHON_ROOT_PATH} \
  45. && ./configure --prefix=${PYTHON_ROOT_PATH} \
  46. && make -j4 \
  47. && make install -j4 \
  48. && rm -f /usr/local/bin/python \
  49. && rm -f /usr/local/bin/pip \
  50. && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \
  51. && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \
  52. && rm -rf /tmp/cpython-3.7.5 \
  53. && rm -f /tmp/v3.7.5.tar.gz
  54. # Set pip source
  55. RUN mkdir -pv /root/.pip \
  56. && echo "[global]" > /root/.pip/pip.conf \
  57. && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \
  58. && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf
  59. # Install pip package
  60. RUN pip install --no-cache-dir \
  61. numpy \
  62. wheel \
  63. nose \
  64. pytest \
  65. pytest-xdist
  66. # Install cmake (v3.14.1)
  67. RUN cd /tmp \
  68. && wget https://github.com/Kitware/CMake/releases/download/v3.14.1/cmake-3.14.1-Linux-x86_64.sh \
  69. && mkdir -p ${CMAKE_ROOT_PATH} \
  70. && bash ./cmake-3.14.1-Linux-x86_64.sh --prefix=${CMAKE_ROOT_PATH} --exclude-subdir --skip-license \
  71. && rm -f /tmp/cmake-3.14.1-Linux-x86_64.sh
  72. # Install MindSpore cuda-9.2 whl package
  73. RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.1.0-alpha/MindSpore/gpu/cuda-9.2/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl