FROM swr.cn-south-1.myhuaweicloud.com/ascendhub/cann:9.0.0-310p-openeuler24.03-py3.11
WORKDIR /tmp
RUN cp -a /etc/yum.repos.d/openEuler.repo /etc/yum.repos.d/openEuler.repo.bak && \
ARCH=$(uname -m | sed 's/x86_64/x86_64/; s/aarch64/aarch64/') && \
echo "[openEuler-everything]" > /etc/yum.repos.d/openEuler.repo && \
echo "name=openEuler-everything" >> /etc/yum.repos.d/openEuler.repo && \
echo "baseurl=https://mirrors.huaweicloud.com/openeuler/openEuler-24.03-LTS/everything/${ARCH}/" >> /etc/yum.repos.d/openEuler.repo && \
echo "enabled=1" >> /etc/yum.repos.d/openEuler.repo && \
echo "gpgcheck=0" >> /etc/yum.repos.d/openEuler.repo && \
echo "gpgkey=https://mirrors.huaweicloud.com/openeuler/openEuler-24.03-LTS/everything/${ARCH}/RPM-GPG-KEY-openEuler" >> /etc/yum.repos.d/openEuler.repo && \
echo "" >> /etc/yum.repos.d/openEuler.repo && \
echo "[openEuler-EPOL]" >> /etc/yum.repos.d/openEuler.repo && \
echo "name=openEuler-epol" >> /etc/yum.repos.d/openEuler.repo && \
echo "baseurl=https://mirrors.huaweicloud.com/openeuler/openEuler-24.03-LTS/EPOL/main/${ARCH}/" >> /etc/yum.repos.d/openEuler.repo && \
echo "enabled=1" >> /etc/yum.repos.d/openEuler.repo && \
echo "gpgcheck=0" >> /etc/yum.repos.d/openEuler.repo && \
echo "" >> /etc/yum.repos.d/openEuler.repo && \
echo "[openEuler-update]" >> /etc/yum.repos.d/openEuler.repo && \
echo "name=openEuler-update" >> /etc/yum.repos.d/openEuler.repo && \
echo "baseurl=https://mirrors.huaweicloud.com/openeuler/openEuler-24.03-LTS/update/${ARCH}/" >> /etc/yum.repos.d/openEuler.repo && \
echo "enabled=1" >> /etc/yum.repos.d/openEuler.repo && \
echo "gpgcheck=0" >> /etc/yum.repos.d/openEuler.repo
RUN export TZ=Asia/Shanghai && \
yum clean all && \
yum makecache && \
yum install ca-certificates -y && \
yum install wget vim dos2unix net-tools openssh openssh-server openssh-clients lsof sshpass -y && \
yum install curl gcc g++ make pkgconfig unzip autoconf git patch -y && \
yum install zlib-devel xz-devel haveged -y && \
yum install python3-pip -y && \
yum clean all
RUN mkdir ~/.pip && touch ~/.pip/pip.conf && \
echo "[global]" > ~/.pip/pip.conf && \
echo "trusted-host=mirrors.aliyun.com" >> ~/.pip/pip.conf && \
echo "index-url=http://mirrors.aliyun.com/pypi/simple" >> ~/.pip/pip.conf && \
echo "timeout=200" >> ~/.pip/pip.conf
RUN pip3 install -U pip && \
pip3 install decorator && \
pip3 install sympy==1.4 && \
pip3 install cffi==1.15.1 && \
pip3 install pyyaml && \
pip3 install pathlib2 && \
pip3 install protobuf && \
pip3 install scipy && \
pip3 install requests && \
pip3 install attrs && \
pip3 install psutil && \
pip3 install faiss-cpu==1.13.2 && \
rm -rf /root/.cache/pip
WORKDIR /tmp
ARG ASCEND_BASE=/usr/local/Ascend
ARG TOOLKIT_PATH=$ASCEND_BASE/ascend-toolkit/latest
USER root
ENV LD_LIBRARY_PATH=$TOOLKIT_PATH/runtime/lib64:$LD_LIBRARY_PATH
ENV TBE_IMPL_PATH=$TOOLKIT_PATH/opp/op_impl/built-in/ai_core/tbe
ENV PATH=$TOOLKIT_PATH/atc/ccec_compiler/bin:$TOOLKIT_PATH/atc/bin:$PATH
ENV ASCEND_OPP_PATH=$TOOLKIT_PATH/opp
ENV ASCEND_AICPU_PATH=$TOOLKIT_PATH
ENV PYTHONPATH=$TBE_IMPL_PATH:$PYTHONPATH
ENV ASCEND_HOME=${ASCEND_BASE}
RUN ARCH=$(uname -m | sed 's/x86_64/x86_64/; s/aarch64/aarch64/') && \
wget https://gitcode.com/Ascend/VisionSDK/releases/download/v26.0.0/Ascend-mindxsdk-mxvision_26.0.0_linux-${ARCH}.run && \
chmod +x Ascend-mindxsdk-mxvision_26.0.0_linux-${ARCH}.run && \
bash Ascend-mindxsdk-mxvision_26.0.0_linux-${ARCH}.run --install --install-path=/usr/local
RUN sed -i '$a\source /usr/local/Ascend/ascend-toolkit/set_env.sh' ~/.bashrc && \
sed -i '$a\source /usr/local/mxVision/set_env.sh' ~/.bashrc && \
sed -i '$a\export LD_LIBRARY_PATH=/usr/local/Ascend/driver/lib64/driver:$LD_LIBRARY_PATH' ~/.bashrc && \
sed -i '$a\export PATH=/usr/local/python3.11.15/bin:$PATH' ~/.bashrc && \
sed -i '$a\export LD_LIBRARY_PATH=/usr/local/python3.11.15/lib:$LD_LIBRARY_PATH' ~/.bashrc
RUN rm -rf ./*
WORKDIR /root