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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. FROM ubuntu:18.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. 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. # 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} --enable-shared \
  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. && pip install --no-cache-dir wheel
  64. # Install cmake (v3.14.1)
  65. RUN cd /tmp \
  66. && wget https://github.com/Kitware/CMake/releases/download/v3.14.1/cmake-3.14.1-Linux-x86_64.sh \
  67. && mkdir -p ${CMAKE_ROOT_PATH} \
  68. && bash ./cmake-3.14.1-Linux-x86_64.sh --prefix=${CMAKE_ROOT_PATH} --exclude-subdir --skip-license \
  69. && rm -f /tmp/cmake-3.14.1-Linux-x86_64.sh