1FROM ubuntu:18.04 2 3MAINTAINER MindSpore Authors 4 5# Set env 6ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 7ENV PATH /usr/local/bin:$PATH 8 9# Install base tools 10RUN apt update \ 11 && DEBIAN_FRONTEND=noninteractive apt install -y \ 12 vim \ 13 wget \ 14 curl \ 15 xz-utils \ 16 net-tools \ 17 openssh-client \ 18 git \ 19 ntpdate \ 20 tzdata \ 21 tcl \ 22 sudo \ 23 bash-completion 24 25# Install compile tools 26RUN DEBIAN_FRONTEND=noninteractive apt install -y \ 27 gcc \ 28 g++ \ 29 zlibc \ 30 make \ 31 libgmp-dev \ 32 patch \ 33 autoconf \ 34 libtool \ 35 automake \ 36 flex \ 37 libjpeg8-dev 38 39# Install the rest dependent tools 40RUN DEBIAN_FRONTEND=noninteractive apt install -y \ 41 libnuma-dev 42 43# Set bash 44RUN echo "dash dash/sh boolean false" | debconf-set-selections 45RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash 46 47# Install python (v3.7.5) 48RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ 49 libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ 50 && cd /tmp \ 51 && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ 52 && tar -xvf v3.7.5.tar.gz \ 53 && cd /tmp/cpython-3.7.5 \ 54 && mkdir -p ${PYTHON_ROOT_PATH} \ 55 && ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \ 56 && make -j4 \ 57 && make install -j4 \ 58 && rm -f /usr/local/bin/python \ 59 && rm -f /usr/local/bin/pip \ 60 && rm -f /usr/local/lib/libpython3.7m.so.1.0 \ 61 && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ 62 && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ 63 && ln -s ${PYTHON_ROOT_PATH}/lib/libpython3.7m.so.1.0 /usr/local/lib/libpython3.7m.so.1.0 \ 64 && ldconfig \ 65 && rm -rf /tmp/cpython-3.7.5 \ 66 && rm -f /tmp/v3.7.5.tar.gz 67 68# Set pip source 69RUN mkdir -pv /root/.pip \ 70 && echo "[global]" > /root/.pip/pip.conf \ 71 && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ 72 && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf 73