2024-05-22 17:29:22 +08:00
|
|
|
FROM nvidia/cuda:12.4.1-base-ubuntu22.04
|
|
|
|
|
|
|
|
# Configure image
|
|
|
|
ARG PYTHON_VERSION=3.10
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
# Install apt dependencies
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
build-essential cmake \
|
|
|
|
git git-lfs openssh-client \
|
2024-05-23 00:10:46 +08:00
|
|
|
nano vim less util-linux \
|
2024-05-22 17:29:22 +08:00
|
|
|
htop atop nvtop \
|
|
|
|
sed gawk grep curl wget \
|
|
|
|
tcpdump sysstat screen \
|
2024-05-23 00:10:46 +08:00
|
|
|
libglib2.0-0 libgl1-mesa-glx libegl1-mesa ffmpeg \
|
2024-05-23 01:06:23 +08:00
|
|
|
python${PYTHON_VERSION} python${PYTHON_VERSION}-venv \
|
2024-05-22 17:29:22 +08:00
|
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2024-05-23 01:06:23 +08:00
|
|
|
# Setup `python`
|
|
|
|
RUN ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python
|
|
|
|
|
2024-05-22 17:29:22 +08:00
|
|
|
# Install gh cli tool
|
|
|
|
RUN (type -p wget >/dev/null || (apt update && apt-get install wget -y)) \
|
|
|
|
&& mkdir -p -m 755 /etc/apt/keyrings \
|
|
|
|
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
|
|
|
|
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
|
|
|
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
|
|
|
&& apt update \
|
2024-05-23 00:10:46 +08:00
|
|
|
&& apt install gh -y \
|
|
|
|
&& apt clean && rm -rf /var/lib/apt/lists/*
|
2024-05-22 17:29:22 +08:00
|
|
|
|
2024-05-22 21:50:01 +08:00
|
|
|
# Install miniconda
|
2024-05-23 00:10:46 +08:00
|
|
|
RUN mkdir -p /root/miniconda3 \
|
|
|
|
&& wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /root/miniconda3/miniconda.sh \
|
|
|
|
&& bash /root/miniconda3/miniconda.sh -b -u -p /root/miniconda3 \
|
|
|
|
&& rm -rf /root/miniconda3/miniconda.sh
|
|
|
|
ENV PATH="/root/miniconda3/bin/:$PATH"
|
|
|
|
|
|
|
|
# Setup conda & create env
|
|
|
|
RUN conda init bash \
|
|
|
|
&& . ~/.bashrc \
|
2024-05-23 01:06:23 +08:00
|
|
|
&& conda create -y -n lerobot python=3.10 \
|
|
|
|
&& conda activate lerobot
|
2024-05-22 17:29:22 +08:00
|
|
|
|
|
|
|
# Install poetry
|
|
|
|
RUN curl -sSL https://install.python-poetry.org | python -
|
2024-05-23 00:10:46 +08:00
|
|
|
ENV PATH="/root/.local/bin:$PATH"
|
2024-05-22 17:29:22 +08:00
|
|
|
|
2024-05-23 01:06:19 +08:00
|
|
|
# Ensure conda environment activation and poetry path in .bashrc
|
|
|
|
RUN echo "source /root/miniconda3/etc/profile.d/conda.sh && conda activate lerobot" >> /root/.bashrc
|
|
|
|
|
2024-05-22 17:29:22 +08:00
|
|
|
# Set EGL as the rendering backend for MuJoCo
|
|
|
|
ENV MUJOCO_GL="egl"
|