@@ -107,9 +107,10 @@ WORKDIR /opt/isaacteleop/install/examples/teleop_ros2/python
107107# Pre-install heavy Python dependencies so they are cached independently of C++ builds.
108108# Copy requirements from the context, avoiding any files from the 'builder' stage.
109109COPY src/core/python/requirements.txt src/core/python/requirements-retargeters.txt /tmp/
110- RUN uv venv --python=${PYTHON_VERSION} && \
111- uv pip install setuptools wheel && \
112- uv pip install --no-build-isolation-package nlopt \
110+ RUN --mount=type=cache,target=/root/.cache/uv,id=isaacteleop-teleop-ros2-uv-${PYTHON_VERSION} \
111+ UV_CACHE_DIR=/root/.cache/uv uv venv --python=${PYTHON_VERSION} && \
112+ UV_CACHE_DIR=/root/.cache/uv uv pip install setuptools wheel && \
113+ UV_CACHE_DIR=/root/.cache/uv uv pip install --no-build-isolation-package nlopt \
113114 -r /tmp/requirements.txt -r /tmp/requirements-retargeters.txt msgpack msgpack-numpy && \
114115 rm /tmp/requirements.txt /tmp/requirements-retargeters.txt
115116
@@ -123,6 +124,7 @@ ENV BASH_ENV=/usr/local/bin/teleop-env-setup
123124RUN echo "source /usr/local/bin/teleop-env-setup" >> /etc/bash.bashrc
124125
125126# Pre-install Python dependencies so uv run doesn't download at every launch.
126- RUN uv sync --no-dev
127+ RUN --mount=type=cache,target=/root/.cache/uv,id=isaacteleop-teleop-ros2-uv-${PYTHON_VERSION} \
128+ UV_CACHE_DIR=/root/.cache/uv uv sync --no-dev
127129
128130ENTRYPOINT ["/usr/local/bin/teleop-entrypoint" , "uv" , "run" , "teleop_ros2_publisher.py" ]
0 commit comments