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