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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 CMAKE_ROOT_PATH /usr/local/cmake-3.14.1
  6. ENV PATH ${CMAKE_ROOT_PATH}/bin:/usr/local/bin:$PATH
  7. ENV LD_LIBRARY_PATH ${PYTHON_ROOT_PATH}/lib
  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. # Configure cuDNN (v7.6.5)
  39. RUN ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5 /usr/local/cuda/lib64/libcudnn.so
  40. # Set bash
  41. RUN echo "dash dash/sh boolean false" | debconf-set-selections
  42. RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
  43. # Install python (v3.7.5)
  44. RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \
  45. libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \
  46. && cd /tmp \
  47. && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \
  48. && tar -xvf v3.7.5.tar.gz \
  49. && cd /tmp/cpython-3.7.5 \
  50. && mkdir -p ${PYTHON_ROOT_PATH} \
  51. && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \
  52. && make -j4 \
  53. && make install -j4 \
  54. && rm -f /usr/local/bin/python \
  55. && rm -f /usr/local/bin/pip \
  56. && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \
  57. && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \
  58. && rm -rf /tmp/cpython-3.7.5 \
  59. && rm -f /tmp/v3.7.5.tar.gz
  60. # Set pip source
  61. RUN mkdir -pv /root/.pip \
  62. && echo "[global]" > /root/.pip/pip.conf \
  63. && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \
  64. && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf \
  65. && pip install --no-cache-dir wheel
  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