|
| 1 | +FROM openvinogithubactions.azurecr.io/dockerhub/nvidia/cuda:11.8.0-runtime-ubuntu22.04 |
| 2 | + |
| 3 | +USER root |
| 4 | + |
| 5 | +# APT configuration |
| 6 | +RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \ |
| 7 | + echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \ |
| 8 | + echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf && \ |
| 9 | + echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf |
| 10 | + |
| 11 | +ENV DEBIAN_FRONTEND="noninteractive" \ |
| 12 | + TZ="Europe/London" |
| 13 | + |
| 14 | +RUN apt-get update && \ |
| 15 | + apt-get install software-properties-common && \ |
| 16 | + add-apt-repository --yes --no-update ppa:git-core/ppa && \ |
| 17 | + add-apt-repository --yes --no-update ppa:deadsnakes/ppa && \ |
| 18 | + apt-get update && \ |
| 19 | + apt-get install \ |
| 20 | + curl \ |
| 21 | + wget \ |
| 22 | + git \ |
| 23 | + gpg-agent \ |
| 24 | + tzdata \ |
| 25 | + # Python |
| 26 | + python3.11-dev \ |
| 27 | + python3.11-venv \ |
| 28 | + python3.11-distutils \ |
| 29 | + # For Java API |
| 30 | + default-jdk \ |
| 31 | + && \ |
| 32 | + rm -rf /var/lib/apt/lists/* |
| 33 | + |
| 34 | +# Install build dependencies |
| 35 | +ADD install_build_dependencies.sh /install_build_dependencies.sh |
| 36 | +RUN chmod +x /install_build_dependencies.sh && \ |
| 37 | + /install_build_dependencies.sh && \ |
| 38 | + rm -rf /var/lib/apt/lists/* |
| 39 | + |
| 40 | +# Install sscache |
| 41 | +ARG SCCACHE_VERSION="v0.7.5" |
| 42 | +ENV SCCACHE_HOME="/opt/sccache" \ |
| 43 | + SCCACHE_PATH="/opt/sccache/sccache" |
| 44 | + |
| 45 | +RUN mkdir ${SCCACHE_HOME} && cd ${SCCACHE_HOME} && \ |
| 46 | + SCCACHE_ARCHIVE="sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" && \ |
| 47 | + curl -SLO https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/${SCCACHE_ARCHIVE} && \ |
| 48 | + tar -xzf ${SCCACHE_ARCHIVE} --strip-components=1 && rm ${SCCACHE_ARCHIVE} |
| 49 | + |
| 50 | +# Install CUDA |
| 51 | +RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \ |
| 52 | + dpkg -i cuda-keyring_1.1-1_all.deb |
| 53 | +RUN apt-get update && apt-get install -y cuda-runtime-11-8 cuda-11-8 && apt-get install -y \ |
| 54 | + libcudnn8=8.9.4.*-1+cuda11.8 \ |
| 55 | + libcudnn8-dev=8.9.4.*-1+cuda11.8 \ |
| 56 | + libcudnn8-samples=8.9.4.*-1+cuda11.8 \ |
| 57 | + libcutensor1=1.7.0.1-1 \ |
| 58 | + libcutensor-dev=1.7.0.1-1 \ |
| 59 | + cuda-drivers |
| 60 | + |
| 61 | +# Setup pip |
| 62 | +ENV PIP_VERSION="24.0" |
| 63 | +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ |
| 64 | + python3.11 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \ |
| 65 | + rm -f get-pip.py |
| 66 | + |
| 67 | +# Use Python 3.11 as default |
| 68 | +# Using venv here 'cause other methods to switch the default Python on Ubuntu 22 break both system and wheels build |
| 69 | +RUN python3.11 -m venv venv |
| 70 | +ENV PATH="/venv/bin:$SCCACHE_HOME:$PATH" |
| 71 | + |
| 72 | +ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION} |
0 commit comments