1FROM ubuntu:18.04 2 3MAINTAINER leonwanghui <leon.wanghui@huawei.com> 4 5# Set env 6ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5 7ENV PATH /usr/local/bin:/root/.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 38# Install the rest dependent tools 39RUN DEBIAN_FRONTEND=noninteractive apt install -y \ 40 libnuma-dev 41 42# Set bash 43RUN echo "dash dash/sh boolean false" | debconf-set-selections 44RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash 45 46# Install python (v3.7.5) 47RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \ 48 libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \ 49 && cd /tmp \ 50 && wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \ 51 && tar -xvf v3.7.5.tar.gz \ 52 && cd /tmp/cpython-3.7.5 \ 53 && mkdir -p ${PYTHON_ROOT_PATH} \ 54 && ./configure --prefix=${PYTHON_ROOT_PATH} \ 55 && make -j4 \ 56 && make install -j4 \ 57 && rm -f /usr/local/bin/python \ 58 && rm -f /usr/local/bin/pip \ 59 && ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \ 60 && ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \ 61 && rm -rf /tmp/cpython-3.7.5 \ 62 && rm -f /tmp/v3.7.5.tar.gz 63 64# Set pip source 65RUN mkdir -pv /root/.pip \ 66 && echo "[global]" > /root/.pip/pip.conf \ 67 && echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \ 68 && echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf 69 70# Install MindSpore cpu whl package 71RUN pip install --no-cache-dir https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.1/MindSpore/cpu/ubuntu_x86/mindspore-1.2.1-cp37-cp37m-linux_x86_64.whl 72