• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1FROM ubuntu:18.04
2
3MAINTAINER MindSpore Authors
4
5# Set env
6ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5
7ENV CMAKE_ROOT_PATH /usr/local/cmake-3.14.1
8ENV PATH ${PYTHON_ROOT_PATH}/bin:${CMAKE_ROOT_PATH}/bin:/usr/local/bin:$PATH
9ENV LD_LIBRARY_PATH ${PYTHON_ROOT_PATH}/lib
10
11# Install base tools
12RUN apt update \
13    && DEBIAN_FRONTEND=noninteractive apt install -y \
14    vim \
15    wget \
16    curl \
17    xz-utils \
18    net-tools \
19    openssh-client \
20    git \
21    ntpdate \
22    tzdata \
23    tcl \
24    sudo \
25    bash-completion
26
27# Install compile tools
28RUN DEBIAN_FRONTEND=noninteractive apt install -y \
29    gcc \
30    g++ \
31    zlibc \
32    make \
33    libgmp-dev \
34    patch \
35    autoconf \
36    libtool \
37    automake \
38    flex \
39    libjpeg8-dev
40
41# Install the rest dependent tools
42RUN DEBIAN_FRONTEND=noninteractive apt install -y \
43    libnuma-dev
44
45# Set bash
46RUN echo "dash dash/sh boolean false" | debconf-set-selections
47RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
48
49# Install python (v3.7.5)
50RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \
51    libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \
52    && cd /tmp \
53    && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \
54    && tar -xvf v3.7.5.tar.gz \
55    && cd /tmp/cpython-3.7.5 \
56    && mkdir -p ${PYTHON_ROOT_PATH} \
57    && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \
58    && make -j4 \
59    && make install -j4 \
60    && rm -f /usr/local/bin/python \
61    && rm -f /usr/local/bin/pip \
62    && rm -f /usr/local/lib/libpython3.7m.so.1.0 \
63    && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \
64    && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \
65    && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \
66    && ldconfig \
67    && rm -rf /tmp/cpython-3.7.5 \
68    && rm -f /tmp/v3.7.5.tar.gz
69
70# Set pip source
71RUN mkdir -pv /root/.pip \
72    && echo "[global]" > /root/.pip/pip.conf \
73    && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \
74    && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf \
75    && pip install --no-cache-dir wheel
76
77# Install cmake (v3.14.1)
78RUN cd /tmp \
79    && wget https://github.com/Kitware/CMake/releases/download/v3.14.1/cmake-3.14.1-Linux-x86_64.sh \
80    && mkdir -p ${CMAKE_ROOT_PATH} \
81    && bash ./cmake-3.14.1-Linux-x86_64.sh --prefix=${CMAKE_ROOT_PATH} --exclude-subdir --skip-license \
82    && rm -f /tmp/cmake-3.14.1-Linux-x86_64.sh
83
84# Install nodejs
85RUN cd /tmp \
86    && wget https://mirrors.huaweicloud.com/nodejs/v12.18.4/node-v12.18.4-linux-x64.tar.gz \
87    && tar -zxf node-v12.18.4-linux-x64.tar.gz \
88    && rm -rf /usr/local/nodejs \
89    && mkdir -p /usr/local/nodejs \
90    && mv /tmp/node-v12.18.4-linux-x64 /usr/local/nodejs/ \
91    && chmod 755 -R /usr/local/nodejs \
92    && ln -sf /usr/local/nodejs/node-v12.18.4-linux-x64/bin/node /usr/bin/node \
93    && ln -sf /usr/local/nodejs/node-v12.18.4-linux-x64/bin/npm /usr/bin/npm \
94    && npm config set registry https://registry.npm.taobao.org/ \
95    && rm -f /tmp/node-v12.18.4-linux-x64.tar.gz