rerunrobot/Dockerfile

47 lines
1.6 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Humanoid Skateboarding (mjlab_husky)
# Ubuntu 22.04 + CUDA 13训练需 NVIDIA 驱动与 nvidia-container-toolkit
#
# 构建:
# docker build -t husky-skate:latest .
#
# 运行GPURerun Web映射 Web + gRPC 两端口(与终端打印一致)
# docker run --gpus all -it --rm -p 8080:8080 -p 9876:9876 husky-skate:latest
#
# 若宿主机 8080/9876 已被其他容器占用,可换映射(示例 18080/19876
# docker run --gpus all -it --rm -p 18080:18080 -p 19876:19876 husky-skate:latest \
# uv run play Mjlab-Skater-Flat-Unitree-G1 --checkpoint_file ckpts/test.pt \
# --viewer rerun --rerun-web-port 18080 --rerun-grpc-port 19876 --no-rerun-open-browser
#
# 仅进 shell 调试:
# docker run --gpus all -it --rm --entrypoint /bin/bash husky-skate:latest
FROM nvidia/cuda:13.0.1-cudnn-devel-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PATH="/root/.local/bin:${PATH}" \
MUJOCO_GL=egl
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
ca-certificates \
build-essential \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
WORKDIR /app
COPY . .
RUN uv sync && uv pip install -e .
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:${PATH}"
# 容器内无桌面:默认 Rerun Web不自动打开浏览器在宿主机打开终端打印的 URL
CMD ["uv", "run", "play", "Mjlab-Skater-Flat-Unitree-G1", "--checkpoint_file", "ckpts/test.pt", "--viewer", "rerun", "--no-rerun-open-browser"]