@@ -5,8 +5,7 @@ FROM ${BASE_IMG} as base
5
5
FROM base as torch-tensorrt-builder-base
6
6
7
7
# Removing any bazel or torch-tensorrt pre-installed from the base image
8
-
9
- RUN rm -rf /opt/torch-tensorrt /usr/bin/bazel
8
+ RUN rm -rf /opt/pytorch/torch_tensorrt /usr/bin/bazel
10
9
11
10
ARG ARCH="x86_64"
12
11
ARG TARGETARCH="amd64"
@@ -27,6 +26,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends locales ninja-b
27
26
28
27
FROM torch-tensorrt-builder-base as torch-tensorrt-builder
29
28
29
+ # Removing any bazel or torch-tensorrt pre-installed from the base image
30
+ RUN rm -rf /opt/pytorch/torch_tensorrt
31
+
30
32
COPY . /workspace/torch_tensorrt/src
31
33
WORKDIR /workspace/torch_tensorrt/src
32
34
RUN cp ./docker/WORKSPACE.docker WORKSPACE
@@ -36,6 +38,9 @@ RUN ./docker/dist-build.sh
36
38
37
39
FROM base as torch-tensorrt
38
40
41
+ # Removing any bazel or torch-tensorrt pre-installed from the base image
42
+ RUN rm -rf /opt/pytorch/torch_tensorrt
43
+
39
44
# copy source repo
40
45
COPY . /workspace/torch_tensorrt
41
46
COPY --from=torch-tensorrt-builder /workspace/torch_tensorrt/src/py/dist/ .
@@ -48,7 +53,7 @@ RUN pip3 install *.whl && rm -fr /workspace/torch_tensorrt/py/dist/* *.whl
48
53
49
54
ENV LD_LIBRARY_PATH /opt/conda/lib/python3.8/site-packages/torch/lib:/opt/conda/lib/python3.8/site-packages/torch_tensorrt/lib:${LD_LIBRARY_PATH}
50
55
ENV PATH /opt/conda/lib/python3.8/site-packages/torch_tensorrt/bin:${PATH}
51
-
56
+ #
52
57
WORKDIR /workspace
53
58
RUN mv /workspace/torch_tensorrt /opt/pytorch/torch_tensorrt
54
59
RUN cp /opt/pytorch/torch_tensorrt/docker/WORKSPACE.docker /opt/pytorch/torch_tensorrt/WORKSPACE
0 commit comments