Skip to content

Commit 0e5a497

Browse files
authored
fix: Unify layers in Docker Container Cleanup (#2275)
1 parent 8efbee9 commit 0e5a497

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

docker/Dockerfile

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,17 @@ RUN mkdir -p "/opt/python3/" &&\
104104

105105
COPY --from=torch-tensorrt-builder /workspace/torch_tensorrt/src/dist/ .
106106

107-
RUN cp /opt/torch_tensorrt/docker/WORKSPACE.docker /opt/torch_tensorrt/WORKSPACE
108-
RUN pip install -r /opt/torch_tensorrt/py/requirements.txt
109-
# Install all dependency wheel files and user-specified TensorRT
110-
RUN pip install *.whl
111-
RUN pip install tensorrt==${TENSORRT_VERSION}.*
112-
113-
# Add the Torch-TensorRT wheel file to the dist directory and delete all other .whl files
114-
RUN rm -fr /workspace/torch_tensorrt/dist/*
115-
RUN mkdir -p /opt/torch_tensorrt/dist/ && mv torch_tensorrt*.whl /opt/torch_tensorrt/dist/
116-
RUN rm -fr *.whl
117-
118-
# Remove other cache files if present
119-
RUN pip cache purge && rm -rf /opt/torch_tensorrt/.mypy_cache
107+
RUN cp /opt/torch_tensorrt/docker/WORKSPACE.docker /opt/torch_tensorrt/WORKSPACE &&\
108+
pip install -r /opt/torch_tensorrt/py/requirements.txt &&\
109+
# Install all dependency wheel files and user-specified TensorRT
110+
pip install *.whl &&\
111+
pip install tensorrt==${TENSORRT_VERSION}.* &&\
112+
# Add the Torch-TensorRT wheel file to the dist directory and delete all other .whl files
113+
rm -fr /workspace/torch_tensorrt/dist/* &&\
114+
mkdir -p /opt/torch_tensorrt/dist/ && mv torch_tensorrt*.whl /opt/torch_tensorrt/dist/ &&\
115+
rm -fr *.whl &&\
116+
# Remove other cache files if present
117+
pip cache purge && rm -rf /opt/torch_tensorrt/.mypy_cache
120118

121119
WORKDIR /opt/torch_tensorrt
122120

0 commit comments

Comments
 (0)