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

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