Skip to content

fix: Decrease Docker container size by 20% #2257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,17 @@ COPY --from=torch-tensorrt-builder /workspace/torch_tensorrt/src/dist/ .

RUN cp /opt/torch_tensorrt/docker/WORKSPACE.docker /opt/torch_tensorrt/WORKSPACE
RUN pip install -r /opt/torch_tensorrt/py/requirements.txt
# Install all dependency wheel files and user-specified TensorRT
RUN pip install *.whl
RUN pip install tensorrt==${TENSORRT_VERSION}.*
RUN pip install *.whl && rm -fr /workspace/torch_tensorrt/dist/* *.whl

# Add the Torch-TensorRT wheel file to the dist directory and delete all other .whl files
RUN rm -fr /workspace/torch_tensorrt/dist/*
RUN mkdir -p /opt/torch_tensorrt/dist/ && mv torch_tensorrt*.whl /opt/torch_tensorrt/dist/
RUN rm -fr *.whl

# Remove other cache files if present
RUN pip cache purge && rm -rf /opt/torch_tensorrt/.mypy_cache

WORKDIR /opt/torch_tensorrt

Expand Down