Skip to content

Commit 9b326e8

Browse files
committed
feat(//docker): Adding Docker 21.03
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 0235491 commit 9b326e8

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

docker/Dockerfile.21.03

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM nvcr.io/nvidia/pytorch:21.03-py3
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+
12+
RUN pip install notebook
13+
14+
COPY . /opt/trtorch
15+
RUN rm /opt/trtorch/WORKSPACE
16+
COPY ./docker/WORKSPACE.cu.docker /opt/trtorch/WORKSPACE
17+
18+
# Workaround for bazel expecting both static and shared versions, we only use shared libraries inside container
19+
RUN cp /usr/lib/x86_64-linux-gnu/libnvinfer.so /usr/lib/x86_64-linux-gnu/libnvinfer_static.a
20+
21+
WORKDIR /opt/trtorch
22+
RUN bazel build //:libtrtorch --compilation_mode opt
23+
24+
WORKDIR /opt/trtorch/py
25+
26+
RUN pip install ipywidgets --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org
27+
RUN jupyter nbextension enable --py widgetsnbextension
28+
29+
# Locale is not set by default
30+
RUN apt-get update && apt-get install -y locales ninja-build && rm -rf /var/lib/apt/lists/* && locale-gen en_US.UTF-8
31+
ENV LANG en_US.UTF-8
32+
ENV LANGUAGE en_US:en
33+
ENV LC_ALL en_US.UTF-8
34+
RUN python3 setup.py install --use-cxx11-abi
35+
36+
RUN conda init bash
37+
38+
ENV LD_LIBRARY_PATH /opt/conda/lib/python3.8/site-packages/torch/lib:$LD_LIBRARY_PATH
39+
40+
WORKDIR /opt/trtorch/
41+
CMD /bin/bash

0 commit comments

Comments
 (0)