whitbrunn's picture
Update g0plus_dockerfile/Dockerfile
a28787a verified
FROM althack/ros2:humble-full AS base
# Switch to root for system operations
USER root
# Set timezone / locale if needed
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
net-tools \
iputils-ping \
ros-${ROS_DISTRO}-rosbag2-storage-mcap \
ros-${ROS_DISTRO}-rosbridge-server \
git \
ca-certificates \
tmux \
vim \
&& \
rm -rf /var/lib/apt/lists/*
# TensorRT related setup
COPY docker-assets/data/TensorRT-10.13.0.35 /usr/TensorRT-10.13.0.35
# Ensure ros user owns home directory
RUN chown -R ros:ros /home/ros
# Switch to ros user
USER ros
WORKDIR /home/ros/g0plus_ros2
# ============================================
# Put in code folders
# ============================================
RUN --mount=type=secret,id=git_token,uid=1000,gid=1000 \
GIT_TOKEN=$(cat /run/secrets/git_token) && \
git clone https://${GIT_TOKEN}@github.com/OpenGalaxea/GalaxeaVLA.git -b main
RUN --mount=type=secret,id=git_token,uid=1000,gid=1000 \
GIT_TOKEN=$(cat /run/secrets/git_token) && \
git clone https://${GIT_TOKEN}@github.com/OpenGalaxea/EFMNode.git -b dev/pp_trt
COPY --chown=ros:ros docker-assets/code/Hierarchical_System /home/ros/g0plus_ros2/Hierarchical_System
# ============================================
# UV installation
# ============================================
WORKDIR /home/ros
ARG http_proxy
ARG https_proxy
RUN bash -c "\
curl -LsSf https://astral.sh/uv/install.sh | bash && \
~/.local/bin/uv --version \
"
ENV PATH="/home/ros/.local/bin:${PATH}"
# ============================================
# Complete G0plus setup
# ============================================
WORKDIR /home/ros/g0plus_ros2/GalaxeaVLA
ENV UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple/
ENV UV_PYTHON_INSTALL_MIRROR=https://gh-proxy.com/https://github.com/astral-sh/python-build-standalone/releases/download
ENV UV_HTTP_TIMEOUT=600
RUN uv sync --index-strategy unsafe-best-match
RUN VIRTUAL_ENV=.venv uv pip install -e .
RUN VIRTUAL_ENV=.venv uv pip install -e .[dev]
# ============================================
# Complete EFMNode, VLM and rosbridge setup
# ============================================
WORKDIR /home/ros/g0plus_ros2/GalaxeaVLA
RUN VIRTUAL_ENV=.venv uv pip install nvtx google-genai dashscope
RUN VIRTUAL_ENV=.venv uv pip install lark==1.3.1 empy==3.3.4 colcon-common-extensions==0.3.0
RUN VIRTUAL_ENV=.venv uv pip install setuptools==59.6.0
RUN VIRTUAL_ENV=.venv uv pip install tensorflow==2.15.0
RUN VIRTUAL_ENV=.venv uv pip install netifaces pymongo tornado cbor2
# ============================================
# Install TensorRT wheel
# ============================================
RUN VIRTUAL_ENV=.venv uv pip install /usr/TensorRT-10.13.0.35/python/tensorrt-10.13.0.35-cp310-none-linux_x86_64.whl
# ============================================
# Build the ROS2 workspace using conda env
# ============================================
WORKDIR /home/ros/g0plus_ros2/Hierarchical_System
RUN bash -c "\
source /opt/ros/humble/setup.bash && \
source /home/ros/g0plus_ros2/GalaxeaVLA/.venv/bin/activate && \
colcon build --symlink-install \
--cmake-args -DPython3_ROOT_DIR=${VIRTUAL_ENV} \
"
# ============================================
# Replace super xml and update ~/.bashrc
# ============================================
COPY --chown=ros:ros docker-assets/super_client_configuration_file.xml.tpl /home/ros/super_client_configuration_file.xml.tpl
RUN echo "source /home/ros/g0plus_ros2/GalaxeaVLA/.venv/bin/activate" >> /home/ros/.bashrc && \
echo "source /home/ros/g0plus_ros2/Hierarchical_System/install/setup.bash" >> /home/ros/.bashrc
# ============================================
# Final image settings
# ============================================
WORKDIR /home/ros