FROM quay.io/pypa/manylinux2010_x86_64:latest ARG PYTHON_VERSION=3.5 ADD scripts/install_manylinux2010.sh /tmp/scripts/install_manylinux2010.sh RUN /tmp/scripts/install_manylinux2010.sh -p ${PYTHON_VERSION} ADD scripts/install_protobuf.sh /tmp/scripts/install_protobuf.sh RUN (source /opt/onnxruntime-python/bin/activate; pip install cmake && /tmp/scripts/install_protobuf.sh && pip uninstall -y cmake) ADD scripts /tmp/scripts RUN (source /opt/onnxruntime-python/bin/activate; /tmp/scripts/install_deps.sh) RUN rm -rf /tmp/scripts # not useful at all except not to see the scripts RUN echo "#!/bin/bash" > /opt/entrypoint.sh && \ echo "set -e" >> /opt/entrypoint.sh && \ echo "source /opt/onnxruntime-python/bin/activate" >> /opt/entrypoint.sh && \ echo "exec \"\$@\"" >> /opt/entrypoint.sh RUN cat /opt/entrypoint.sh RUN chmod +x /opt/entrypoint.sh RUN NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \ curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/rhel6/x86_64/7fa2af80.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \ echo "$NVIDIA_GPGKEY_SUM /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" | sha256sum -c - COPY cuda_manylinux2010.repo /etc/yum.repos.d/cuda.repo ENV CUDA_VERSION 10.1.168 ENV CUDA_PKG_VERSION 10-1-$CUDA_VERSION-1 # For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a RUN yum install -y \ cuda-cudart-$CUDA_PKG_VERSION \ cuda-compat-10-1 \ cuda-libraries-$CUDA_PKG_VERSION \ cuda-nvtx-$CUDA_PKG_VERSION \ cuda-libraries-dev-$CUDA_PKG_VERSION \ cuda-nvml-dev-$CUDA_PKG_VERSION \ cuda-minimal-build-$CUDA_PKG_VERSION \ cuda-command-line-tools-$CUDA_PKG_VERSION \ && \ ln -s cuda-10.1 /usr/local/cuda && \ rm -rf /var/cache/yum/* # cuDNN license: https://developer.nvidia.com/cudnn/license_agreement RUN CUDNN_DOWNLOAD_SUM=e956c6f9222fcb867a10449cfc76dee5cfd7c7531021d95fe9586d7e043b57d7 && \ curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.0/cudnn-10.1-linux-x64-v7.6.0.64.tgz -O && \ echo "$CUDNN_DOWNLOAD_SUM cudnn-10.1-linux-x64-v7.6.0.64.tgz" | sha256sum -c - && \ tar --no-same-owner -xzf cudnn-10.1-linux-x64-v7.6.0.64.tgz -C /usr/local && \ rm cudnn-10.1-linux-x64-v7.6.0.64.tgz && \ ldconfig ENV LD_LIBRARY_PATH /usr/local/openblas/lib:/usr/local/cuda/lib64/stubs:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:$LD_LIBRARY_PATH ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} # nvidia-container-runtime ENV NVIDIA_VISIBLE_DEVICES all ENV NVIDIA_DRIVER_CAPABILITIES compute,utility ENV NVIDIA_REQUIRE_CUDA "cuda>=10.1 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411" ARG BUILD_UID=1000 ARG BUILD_USER=onnxruntimedev WORKDIR /home/$BUILD_USER # --disabled-password RUN adduser --comment 'onnxruntime Build User' $BUILD_USER --uid $BUILD_UID USER $BUILD_USER ENTRYPOINT ["/opt/entrypoint.sh"]