lerobot/docker/lerobot-cpu/Dockerfile

30 lines
1.0 KiB
Docker
Raw Normal View History

2024-04-25 20:58:39 +08:00
# Configure image
ARG PYTHON_VERSION=3.10
FROM python:${PYTHON_VERSION}-slim
2025-02-26 23:36:03 +08:00
# Configure environment variables
2024-04-25 20:58:39 +08:00
ARG PYTHON_VERSION
2025-02-26 23:36:03 +08:00
ENV DEBIAN_FRONTEND=noninteractive
ENV MUJOCO_GL="egl"
ENV PATH="/opt/venv/bin:$PATH"
2024-04-25 20:58:39 +08:00
2025-02-26 23:36:03 +08:00
# Install dependencies and set up Python in a single layer
2024-04-25 20:58:39 +08:00
RUN apt-get update && apt-get install -y --no-install-recommends \
2025-02-26 23:36:03 +08:00
build-essential cmake git \
2024-06-15 00:11:19 +08:00
libglib2.0-0 libgl1-mesa-glx libegl1-mesa ffmpeg \
2025-02-01 19:06:11 +08:00
speech-dispatcher libgeos-dev \
2025-02-26 23:36:03 +08:00
&& ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python \
&& python -m venv /opt/venv \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& echo "source /opt/venv/bin/activate" >> /root/.bashrc
2024-04-25 20:58:39 +08:00
2025-02-26 23:36:03 +08:00
# Clone repository and install LeRobot in a single layer
COPY . /lerobot
2024-04-25 20:58:39 +08:00
WORKDIR /lerobot
2025-02-26 23:36:03 +08:00
RUN /opt/venv/bin/pip install --upgrade --no-cache-dir pip \
&& /opt/venv/bin/pip install --no-cache-dir ".[test, aloha, xarm, pusht, dynamixel]" \
--extra-index-url https://download.pytorch.org/whl/cpu
2024-04-25 20:58:39 +08:00
# Execute in bash shell rather than python
CMD ["/bin/bash"]