@@ -39,24 +39,27 @@ WORKDIR /home/$DOCKER_USER
3939RUN python -m venv /home/$DOCKER_USER/.venv
4040ENV PATH="/home/$DOCKER_USER/.venv/bin:${PATH}"
4141
42+ # Install uv for quicker package installations
43+ RUN pip install uv
44+
4245# Update to newer pip/setuptools/wheel (setuptools >= 70.0.0 due to CVE-2024-6345
4346# and CVE-2025-47273, wheel >= 0.38.0 due to CVE-2022-40898) and delete old system
4447# version (we essentially use apt:python3-pip to bootstrap pip)
45- RUN pip install --upgrade pip~=25.2 setuptools~=78.1.1 wheel~=0.45.1
48+ RUN uv pip install --upgrade pip~=25.2 setuptools~=78.1.1 wheel~=0.45.1
4649
4750# Install non-torch requirements
4851COPY --chown=$DOCKER_USER:$DOCKER_USER requirements.txt .
49- RUN pip install -r requirements.txt
52+ RUN uv pip install -r requirements.txt
5053
5154# Bring wheels into image
5255RUN test -n "${TORCH_WHEEL}" && test -n "${TORCH_AO_WHEEL}"
5356COPY --chown=$DOCKER_USER:$DOCKER_USER ${TORCH_WHEEL} /home/$DOCKER_USER/
5457COPY --chown=$DOCKER_USER:$DOCKER_USER ${TORCH_AO_WHEEL} /home/$DOCKER_USER/
5558
5659# Install wheels
57- RUN set -eux && pip install --no-deps "$(basename " $TORCH_WHEEL")" && rm "$(basename " $TORCH_WHEEL")"
58- RUN set -eux && pip install --no-deps "$(basename " $TORCH_AO_WHEEL")" && rm "$(basename " $TORCH_AO_WHEEL")"
59- RUN pip install --pre torchvision==0.25.0.dev20260130 --index-url https://download.pytorch.org/whl/nightly/cpu --no-deps
60+ RUN set -eux && uv pip install --no-deps "$(basename " $TORCH_WHEEL")" && rm "$(basename " $TORCH_WHEEL")"
61+ RUN set -eux && uv pip install --no-deps "$(basename " $TORCH_AO_WHEEL")" && rm "$(basename " $TORCH_AO_WHEEL")"
62+ RUN uv pip install --pre torchvision==0.25.0.dev20260130 --index-url https://download.pytorch.org/whl/nightly/cpu --no-deps
6063
6164# Copy examples/tests into image
6265COPY --chown=$DOCKER_USER:$DOCKER_USER examples/ /home/$DOCKER_USER/
@@ -74,7 +77,6 @@ ENV DOCKER_USER=${USERNAME}
7477# Runtime OS bits + UI
7578RUN set -eux && \
7679 apt-get update && \
77- apt-get install -y --no-install-recommends && \
7880 rm -rf /var/lib/apt/lists/* && \
7981 if ! id "$DOCKER_USER" >/dev/null 2>&1; then useradd --create-home -s /bin/bash "$DOCKER_USER" ; fi && \
8082 echo '[ -n "$TERM" -a -r "$HOME/welcome.txt" ] && cat "$HOME/welcome.txt"' >> /etc/bash.bashrc && \
0 commit comments