Skip to content

Commit aa0c48f

Browse files
authored
reduce img size by remove nvidia py pkgs (#24)
* reduce img size
1 parent 5fb7653 commit aa0c48f

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

docker_PaddleOCR/paddle-ocr.Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,9 @@ RUN set -eux && source /opt/utils/script-setup.sh \
2727
&& pip install -U --no-cache-dir paddleocr \
2828
# Step 4. install PaddleOCR fixes for Python>=3.10 compatibility
2929
&& pip uninstall -y attrdict && pip install -UI --no-cache-dir attrdict3 \
30-
# Step 5. cleanup
30+
# Step 5. uninstall nvidia python packages if any
31+
&& echo "Try to uninstall nvidia python packages to reduce storage size..." \
32+
&& pip freeze | grep -i '^nvidia-' | cut -d'=' -f1 | xargs -r pip uninstall -y \
33+
&& apt-get -qq update --fix-missing && apt-get -qq install -y --no-install-recommends --allow-change-held-packages libcusparselt0 libnccl2 libnccl-dev \
34+
# Step 6. cleanup
3135
&& install__clean && list_installed_packages

docker_aidoc/miner.Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ RUN set -eux \
2020
libreoffice poppler-utils \
2121
&& pip install -U magic-pdf[full] modelscope \
2222
# ----------
23+
&& echo "Try to uninstall nvidia python packages to reduce storage size..." \
24+
&& pip freeze | grep -i '^nvidia-' | cut -d'=' -f1 | xargs -r pip uninstall -y \
25+
&& apt-get -qq update --fix-missing && apt-get -qq install -y --no-install-recommends --allow-change-held-packages libcusparselt0 libnccl2 libnccl-dev \
26+
# ----------
2327
&& rm -rf /var/lib/apt/lists/* \
2428
&& source /opt/utils/script-setup.sh \
2529
&& install__clean && list_installed_packages

docker_vllm/vllm-cuda.Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ RUN set -eux && source /opt/utils/script-setup.sh \
1414
&& echo "Detected CUDA version=${CUDA_VER} and IDX=${IDX}" \
1515
# -----------------------------
1616
&& pip install vllm --index-url "https://download.pytorch.org/whl/${IDX}" --extra-index-url https://pypi.org/simple \
17+
&& echo "Try to uninstall nvidia python packages to reduce storage size..." \
18+
&& pip freeze | grep -i '^nvidia-' | cut -d'=' -f1 | xargs -r pip uninstall -y \
19+
&& apt-get -qq update --fix-missing && apt-get -qq install -y --no-install-recommends --allow-change-held-packages libcusparselt0 libnccl2 libnccl-dev \
1720
# && cd /tmp/ \
1821
# && git clone https://github.com/vllm-project/vllm.git \
1922
# && cd /tmp/vllm \

0 commit comments

Comments
 (0)