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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. # 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. && pip install --no-cache-dir wheel
  60. # Install cmake (v3.14.1)
  61. RUN cd /tmp \
  62. && wget https://github.com/Kitware/CMake/releases/download/v3.14.1/cmake-3.14.1-Linux-x86_64.sh \
  63. && mkdir -p ${CMAKE_ROOT_PATH} \
  64. && bash ./cmake-3.14.1-Linux-x86_64.sh --prefix=${CMAKE_ROOT_PATH} --exclude-subdir --skip-license \
  65. && rm -f /tmp/cmake-3.14.1-Linux-x86_64.sh