| 
1 | 1 | FROM nvidia/cuda:12.4.1-base-ubuntu22.04  | 
2 | 2 | 
 
  | 
3 |  | -# Configure image  | 
 | 3 | +# Configure environment variables  | 
4 | 4 | ARG PYTHON_VERSION=3.10  | 
5 |  | -ARG DEBIAN_FRONTEND=noninteractive  | 
6 |  | - | 
 | 5 | +ENV DEBIAN_FRONTEND=noninteractive  | 
 | 6 | +ENV MUJOCO_GL="egl"  | 
 | 7 | +ENV PATH="/opt/venv/bin:$PATH"  | 
7 | 8 | 
 
  | 
8 |  | -# Install apt dependencies  | 
 | 9 | +# Install dependencies and set up Python in a single layer  | 
9 | 10 | RUN apt-get update && apt-get install -y --no-install-recommends \  | 
10 | 11 |     build-essential cmake git git-lfs \  | 
11 | 12 |     libglib2.0-0 libgl1-mesa-glx libegl1-mesa ffmpeg \  | 
12 | 13 |     speech-dispatcher libgeos-dev \  | 
13 | 14 |     python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv \  | 
14 |  | -    && apt-get clean && rm -rf /var/lib/apt/lists/*  | 
15 |  | - | 
 | 15 | +    && ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python \  | 
 | 16 | +    && python -m venv /opt/venv \  | 
 | 17 | +    && apt-get clean && rm -rf /var/lib/apt/lists/* \  | 
 | 18 | +    && echo "source /opt/venv/bin/activate" >> /root/.bashrc  | 
16 | 19 | 
 
  | 
17 |  | -# Create virtual environment  | 
18 |  | -RUN ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python  | 
19 |  | -RUN python -m venv /opt/venv  | 
20 |  | -ENV PATH="/opt/venv/bin:$PATH"  | 
21 |  | -RUN echo "source /opt/venv/bin/activate" >> /root/.bashrc  | 
22 |  | - | 
23 |  | -# Install LeRobot  | 
24 |  | -RUN git lfs install  | 
25 |  | -RUN git clone https://github.com/huggingface/lerobot.git /lerobot  | 
 | 20 | +# Clone repository and install LeRobot in a single layer  | 
26 | 21 | WORKDIR /lerobot  | 
27 |  | -RUN pip install --upgrade --no-cache-dir pip  | 
28 |  | -RUN pip install --no-cache-dir ".[test, aloha, xarm, pusht, dynamixel]"  | 
29 |  | - | 
30 |  | -# Set EGL as the rendering backend for MuJoCo  | 
31 |  | -ENV MUJOCO_GL="egl"  | 
 | 22 | +RUN git lfs install \  | 
 | 23 | +    && git clone https://github.com/huggingface/lerobot.git . \  | 
 | 24 | +    && /opt/venv/bin/pip install --upgrade --no-cache-dir pip \  | 
 | 25 | +    && /opt/venv/bin/pip install --no-cache-dir ".[test, aloha, xarm, pusht, dynamixel]"  | 
0 commit comments