Upload dockerfile with huggingface_hub
Browse files- dockerfile +32 -0
dockerfile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM nvcr.io/nvidia/pytorch:25.04-py3
|
| 2 |
+
|
| 3 |
+
ARG PYPI_MIRROR=https://pypi.org/simple
|
| 4 |
+
ARG PIP_EXTRA_INDEX_URL=
|
| 5 |
+
ARG DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
ARG CLEAR_PIP_CONSTRAINTS=1
|
| 8 |
+
RUN set -eux; \
|
| 9 |
+
if [ "${CLEAR_PIP_CONSTRAINTS}" = "1" ] && [ -f /etc/pip/constraint.txt ]; then \
|
| 10 |
+
cp /etc/pip/constraint.txt /etc/pip/constraint.txt.bak; \
|
| 11 |
+
: > /etc/pip/constraint.txt; \
|
| 12 |
+
fi
|
| 13 |
+
|
| 14 |
+
RUN apt-get update && \
|
| 15 |
+
apt-get install -y --no-install-recommends \
|
| 16 |
+
git jq vim less rsync wget curl ca-certificates openssh-client \
|
| 17 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
+
|
| 19 |
+
WORKDIR /workspace
|
| 20 |
+
|
| 21 |
+
COPY requirements.txt /workspace/requirements.txt
|
| 22 |
+
RUN pip install --no-cache-dir -i ${PYPI_MIRROR} \
|
| 23 |
+
${PIP_EXTRA_INDEX_URL:+--extra-index-url ${PIP_EXTRA_INDEX_URL}} \
|
| 24 |
+
-r /workspace/requirements.txt
|
| 25 |
+
|
| 26 |
+
# Remove nvidia-modelopt to avoid from_pretrained interference
|
| 27 |
+
RUN pip uninstall -y nvidia-modelopt || true
|
| 28 |
+
|
| 29 |
+
RUN rm -r /workspace/requirements.txt /workspace/README.md /workspace/docker-examples /workspace/license.txt /workspace/tutorials
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
CMD ["/bin/bash"]
|