1FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04
2
3LABEL maintainer="Jan Prach <jendap@google.com>"
4
5# In the Ubuntu 16.04 images, cudnn is placed in system paths. Move them to
6# /usr/local/cuda
7RUN cp -P /usr/include/cudnn.h /usr/local/cuda/include
8RUN cp -P /usr/lib/x86_64-linux-gnu/libcudnn* /usr/local/cuda/lib64
9
10# Installs TensorRT, which is not included in NVIDIA Docker containers.
11RUN apt-get update \
12        && apt-get install nvinfer-runtime-trt-repo-ubuntu1604-5.0.2-ga-cuda10.0 \
13        && apt-get update \
14        && apt-get install -y --no-install-recommends libnvinfer-dev=5.0.2-1+cuda10.0
15
16# Copy and run the install scripts.
17COPY install/*.sh /install/
18ARG DEBIAN_FRONTEND=noninteractive
19RUN /install/install_bootstrap_deb_packages.sh
20RUN add-apt-repository -y ppa:openjdk-r/ppa && \
21    add-apt-repository -y ppa:george-edison55/cmake-3.x
22RUN /install/install_deb_packages.sh
23
24RUN /install/install_pip_packages.sh
25RUN /install/install_bazel.sh
26RUN /install/install_golang.sh
27
28# Set up the master bazelrc configuration file.
29COPY install/.bazelrc /etc/bazel.bazelrc
30ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
31
32# Link NCCL libray and header where the build script expects them.
33RUN mkdir /usr/local/cuda/lib &&  \
34    ln -s /usr/lib/x86_64-linux-gnu/libnccl.so.2 /usr/local/cuda/lib/libnccl.so.2 && \
35    ln -s /usr/include/nccl.h /usr/local/cuda/include/nccl.h
36
37# Configure the build for our CUDA configuration.
38ENV TF_NEED_CUDA 1
39ENV TF_NEED_TENSORRT 1
40