Skip to content

Commit 8bebf09

Browse files
authored
Merge pull request #846 from NVIDIA/docker_uninstall_fix
fix: Fix existing uninstallation of Torch-TRT
2 parents 4fd886d + 9ddd7a8 commit 8bebf09

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

docker/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ FROM ${BASE_IMG} as base
55
FROM base as torch-tensorrt-builder-base
66

77
# 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
109

1110
ARG ARCH="x86_64"
1211
ARG TARGETARCH="amd64"
@@ -27,6 +26,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends locales ninja-b
2726

2827
FROM torch-tensorrt-builder-base as torch-tensorrt-builder
2928

29+
# Removing any bazel or torch-tensorrt pre-installed from the base image
30+
RUN rm -rf /opt/pytorch/torch_tensorrt
31+
3032
COPY . /workspace/torch_tensorrt/src
3133
WORKDIR /workspace/torch_tensorrt/src
3234
RUN cp ./docker/WORKSPACE.docker WORKSPACE
@@ -36,6 +38,9 @@ RUN ./docker/dist-build.sh
3638

3739
FROM base as torch-tensorrt
3840

41+
# Removing any bazel or torch-tensorrt pre-installed from the base image
42+
RUN rm -rf /opt/pytorch/torch_tensorrt
43+
3944
# copy source repo
4045
COPY . /workspace/torch_tensorrt
4146
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
4853

4954
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}
5055
ENV PATH /opt/conda/lib/python3.8/site-packages/torch_tensorrt/bin:${PATH}
51-
56+
#
5257
WORKDIR /workspace
5358
RUN mv /workspace/torch_tensorrt /opt/pytorch/torch_tensorrt
5459
RUN cp /opt/pytorch/torch_tensorrt/docker/WORKSPACE.docker /opt/pytorch/torch_tensorrt/WORKSPACE

0 commit comments

Comments
 (0)