ultralytics_ros icon indicating copy to clipboard operation
ultralytics_ros copied to clipboard

Dockerfile for Humble version

Open fatemeh-mohseni-AI opened this issue 9 months ago • 0 comments

Branch

humble-devel

Question

I have build a sample Dockerfile for Humble version, but it has some errors . Do you have any Dockerfile for Humble version ?

this is mine :

FROM --platform=linux/amd64 ros:humble-ros-base

ENV repo=/root/ros2_ws/src/Ros2_Yolov8
ENV wd=/root/ros2_ws
ENV ROS_DISTRO=humble

RUN mkdir -p $repo
WORKDIR $wd

COPY . $repo

# Set Environment Variables
ENV DEBIAN_FRONTEND noninteractive


# Add ROS 2 package repositories
RUN apt-get update && apt-get install -y software-properties-common && \
    add-apt-repository universe && \
    apt-add-repository restricted && \
    apt-add-repository multiverse && \
    apt-get update

# Install required packages
RUN apt-get update && apt-get upgrade -y && \
    apt-get install --no-install-recommends -y \
        python3-pip \
        ros-$ROS_DISTRO-ament-cmake \
        ros-$ROS_DISTRO-rclpy \
        ros-$ROS_DISTRO-sensor-msgs \
        ros-$ROS_DISTRO-vision-msgs \
        ros-$ROS_DISTRO-cv-bridge \
        ros-$ROS_DISTRO-image-geometry \
        ros-$ROS_DISTRO-image-transport \
        ros-$ROS_DISTRO-pcl-ros \
        ros-$ROS_DISTRO-image-view \
        python3-rosdep \
        python-is-python3 \
        ffmpeg libsm6 libxext6 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN rosdep fix-permissions && \
    rosdep update --include-eol-distros && \
    rosdep install -r -y -i --from-paths . && \
    python3 -m pip install -r $repo/requirements.txt && \
    /bin/bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && colcon build"


# Make the entrypoint script executable
RUN chmod +x $repo/docker/entrypoint.sh

# Set the entrypoint to the script
ENTRYPOINT ["/root/ros2_ws/src/Ros2_Yolov8/docker/entrypoint.sh"]
#CMD ["ros2", "launch", "ultralytics_ros", "tracker.launch.xml", "debug:=true"]

Additional

No response

fatemeh-mohseni-AI avatar May 21 '24 09:05 fatemeh-mohseni-AI