Skip to content

Commit 3de9048

Browse files
committed
Added 21.07 Dockerfile
Signed-off-by: Boris Fomitchev <[email protected]>
1 parent 148c978 commit 3de9048

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docker/Dockerfile.21.07

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM nvcr.io/nvidia/pytorch:21.07-py3 as builder
2+
3+
RUN apt-get update && apt-get install -y curl gnupg && rm -rf /var/lib/apt/lists/*
4+
5+
RUN curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
6+
RUN mv bazel.gpg /etc/apt/trusted.gpg.d/
7+
RUN echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
8+
9+
RUN apt-get update && apt-get install -y bazel-4.0.0 && rm -rf /var/lib/apt/lists/*
10+
RUN ln -s /usr/bin/bazel-4.0.0 /usr/bin/bazel
11+
# Workaround for bazel expecting both static and shared versions, we only use shared libraries inside container
12+
RUN cp /usr/lib/x86_64-linux-gnu/libnvinfer.so /usr/lib/x86_64-linux-gnu/libnvinfer_static.a
13+
14+
RUN pip install notebook
15+
16+
FROM builder as trtorch
17+
18+
COPY . /opt/trtorch
19+
RUN rm /opt/trtorch/WORKSPACE
20+
COPY ./docker/WORKSPACE.cu.docker /opt/trtorch/WORKSPACE
21+
22+
WORKDIR /opt/trtorch
23+
RUN bazel build //:libtrtorch --compilation_mode opt
24+
25+
WORKDIR /opt/trtorch/py
26+
27+
RUN pip install ipywidgets --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org
28+
RUN jupyter nbextension enable --py widgetsnbextension
29+
30+
# Locale is not set by default
31+
RUN apt-get update && apt-get install -y locales ninja-build && rm -rf /var/lib/apt/lists/* && locale-gen en_US.UTF-8
32+
ENV LANG en_US.UTF-8
33+
ENV LANGUAGE en_US:en
34+
ENV LC_ALL en_US.UTF-8
35+
RUN python3 setup.py install --use-cxx11-abi
36+
37+
RUN conda init bash
38+
39+
ENV LD_LIBRARY_PATH /opt/conda/lib/python3.8/site-packages/torch/lib:$LD_LIBRARY_PATH
40+
41+
WORKDIR /opt/trtorch/
42+
CMD /bin/bash

0 commit comments

Comments
 (0)