From 5239c0866fb35283e43b61ff68b4dd5247264af3 Mon Sep 17 00:00:00 2001 From: rtarun1 Date: Thu, 3 Apr 2025 01:11:18 +0530 Subject: [PATCH 1/4] added noetic Dockerfile --- noetic/Dockerfile | 71 ++++++++++++++++++++++++++++++++++++++++ noetic/ros_entrypoint.sh | 6 ++++ 2 files changed, 77 insertions(+) create mode 100644 noetic/Dockerfile create mode 100644 noetic/ros_entrypoint.sh diff --git a/noetic/Dockerfile b/noetic/Dockerfile new file mode 100644 index 0000000..9649995 --- /dev/null +++ b/noetic/Dockerfile @@ -0,0 +1,71 @@ +FROM ubuntu:focal + +# basic args +ENV ROS_DISTRO=noetic +ARG USERNAME=user +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# Add the following labels +LABEL org.opencontainers.image.description="Docker Development Container" +LABEL org.opencontainers.image.title="ROS1Dev" +LABEL org.opencontainers.image.vendor="Tarun R" +LABEL org.opencontainers.image.source="https://github.com/rtarun1/DockerForROS2Development" +LABEL maintainer="tarun.ramak@gmail.com" +LABEL org.opencontainers.image.licenses="MIT" + + +RUN apt-get update && apt-get install -q -y --no-install-recommends \ + dirmngr \ + gnupg2 \ + && rm -rf /var/lib/apt/lists/* + +# install bootstrap tools +RUN apt-get update && apt-get install --no-install-recommends -y \ + build-essential \ + python3-rosdep \ + python3-rosinstall \ + python3-vcstools \ + && rm -rf /var/lib/apt/lists/* + +# setup keys +RUN set -eux; \ + key='C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'; \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + mkdir -p /usr/share/keyrings; \ + gpg --batch --export "$key" > /usr/share/keyrings/ros1-latest-archive-keyring.gpg; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" + +# setup sources.list +RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list + +# setup environment +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +# Create non root user with sudo privilege +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ + && apt-get update \ + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME +USER $USERNAME + +ENV ROS_DISTRO $ROS_DISTRO + +RUN sudo rosdep init && \ + rosdep update --rosdistro $ROS_DISTRO + +# install ros packages +RUN apt-get update && apt-get install -y --no-install-recommends \ + ros-$ROS_DISTRO-desktop-full=1.5.0-1* \ + && rm -rf /var/lib/apt/lists/* + +# setup entrypoint +COPY ./ros_entrypoint.sh / + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["bash"] \ No newline at end of file diff --git a/noetic/ros_entrypoint.sh b/noetic/ros_entrypoint.sh new file mode 100644 index 0000000..3214333 --- /dev/null +++ b/noetic/ros_entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +# setup ros environment +source "/opt/ros/$ROS_DISTRO/setup.bash" -- +exec "$@" \ No newline at end of file From b2247a25ddcb14edd4764ecf272bb468e3d012a5 Mon Sep 17 00:00:00 2001 From: rtarun1 Date: Thu, 3 Apr 2025 01:39:47 +0530 Subject: [PATCH 2/4] noetic working --- noetic/Dockerfile | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/noetic/Dockerfile b/noetic/Dockerfile index 9649995..ac055ee 100644 --- a/noetic/Dockerfile +++ b/noetic/Dockerfile @@ -13,21 +13,22 @@ LABEL org.opencontainers.image.vendor="Tarun R" LABEL org.opencontainers.image.source="https://github.com/rtarun1/DockerForROS2Development" LABEL maintainer="tarun.ramak@gmail.com" LABEL org.opencontainers.image.licenses="MIT" +# handle default shell +SHELL ["/bin/bash", "-c"] +ENV SHELL=/bin/bash +# setup timezone +RUN echo 'Asia/Kolkata' > /etc/timezone && \ + ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime && \ + apt-get update && \ + apt-get install -q -y --no-install-recommends tzdata && \ + rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -q -y --no-install-recommends \ dirmngr \ gnupg2 \ && rm -rf /var/lib/apt/lists/* -# install bootstrap tools -RUN apt-get update && apt-get install --no-install-recommends -y \ - build-essential \ - python3-rosdep \ - python3-rosinstall \ - python3-vcstools \ - && rm -rf /var/lib/apt/lists/* - # setup keys RUN set -eux; \ key='C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'; \ @@ -54,15 +55,25 @@ RUN groupadd --gid $USER_GID $USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME USER $USERNAME -ENV ROS_DISTRO $ROS_DISTRO - -RUN sudo rosdep init && \ - rosdep update --rosdistro $ROS_DISTRO +ENV ROS_DISTRO=$ROS_DISTRO # install ros packages -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends \ ros-$ROS_DISTRO-desktop-full=1.5.0-1* \ - && rm -rf /var/lib/apt/lists/* + && sudo rm -rf /var/lib/apt/lists/* + +# install bootstrap tools +RUN sudo apt-get update && sudo apt-get install --no-install-recommends -y \ + build-essential \ + python3-rosdep \ + python3-rosinstall \ + python3-vcstools \ + git \ + && sudo rm -rf /var/lib/apt/lists/* + +# bootstrap rosdep +RUN sudo rosdep init && \ + rosdep update --rosdistro $ROS_DISTRO # setup entrypoint COPY ./ros_entrypoint.sh / From 728936217944cffb603b659eacb6ec8e3a0ff3d5 Mon Sep 17 00:00:00 2001 From: rtarun1 Date: Sat, 5 Apr 2025 15:02:23 +0530 Subject: [PATCH 3/4] added suggested changes, added sourcing in bashrc --- noetic/Dockerfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/noetic/Dockerfile b/noetic/Dockerfile index ac055ee..df55245 100644 --- a/noetic/Dockerfile +++ b/noetic/Dockerfile @@ -2,15 +2,15 @@ FROM ubuntu:focal # basic args ENV ROS_DISTRO=noetic -ARG USERNAME=user +ARG USERNAME=container_user ARG USER_UID=1000 ARG USER_GID=$USER_UID # Add the following labels -LABEL org.opencontainers.image.description="Docker Development Container" -LABEL org.opencontainers.image.title="ROS1Dev" +LABEL org.opencontainers.image.description="ROS1 Development Container" +LABEL org.opencontainers.image.title="ROS1DevCon" LABEL org.opencontainers.image.vendor="Tarun R" -LABEL org.opencontainers.image.source="https://github.com/rtarun1/DockerForROS2Development" +LABEL org.opencontainers.image.source="https://github.com/soham2560/DockerForROS2Development" LABEL maintainer="tarun.ramak@gmail.com" LABEL org.opencontainers.image.licenses="MIT" # handle default shell @@ -57,11 +57,15 @@ USER $USERNAME ENV ROS_DISTRO=$ROS_DISTRO -# install ros packages +# install ros1 packages RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends \ ros-$ROS_DISTRO-desktop-full=1.5.0-1* \ && sudo rm -rf /var/lib/apt/lists/* +# setup entrypoint +COPY ./ros_entrypoint.sh / +ENTRYPOINT ["/ros_entrypoint.sh"] + # install bootstrap tools RUN sudo apt-get update && sudo apt-get install --no-install-recommends -y \ build-essential \ @@ -75,8 +79,4 @@ RUN sudo apt-get update && sudo apt-get install --no-install-recommends -y \ RUN sudo rosdep init && \ rosdep update --rosdistro $ROS_DISTRO -# setup entrypoint -COPY ./ros_entrypoint.sh / - -ENTRYPOINT ["/ros_entrypoint.sh"] -CMD ["bash"] \ No newline at end of file +RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" | sudo tee -a ~/.bashrc > /dev/null \ No newline at end of file From 97f75c32b345a3642bbca9515b35afe2e6dfbbf9 Mon Sep 17 00:00:00 2001 From: rtarun1 Date: Sat, 5 Apr 2025 16:56:34 +0530 Subject: [PATCH 4/4] added noetic documentation and referred the husky and p3dx repos --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index da78a43..b1a4794 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Docker Images for ROS 2 Development +# Docker Images for ROS Development -This repository provides Docker images designed to simplify ROS 2 development. These images come pre-configured with the necessary ROS 2 packages and tools, allowing you to get started with your robotics projects quickly and efficiently. +This repository provides Docker images designed to simplify ROS 2 and ROS 1 development. These images come pre-configured with the necessary ROS packages and tools, allowing you to get started with your robotics projects quickly and efficiently. ## Available Images @@ -10,6 +10,7 @@ The following Docker images are available: * `humble-garden`: Extends the `humble` image and includes Gazebo Garden, a powerful 3D robotics simulator. * `iron`: Based on `ubuntu:jammy`, this image includes ROS 2 Iron Irwini packages and a non-root user. * `iron-garden`: Extends the `iron` image and includes Gazebo Garden. +* `noetic`: Based on `ubuntu:focal`, this image includes ROS Noetic Ninjemys packages and a non-root user. **Important Note:** The `iron` and `iron-garden` images are currently **under development** and have not been heavily tested. They may be unstable or contain significant bugs. @@ -69,6 +70,8 @@ The following repositories demonstrate how to use these Docker images in real-wo * **[6DOF_ObjectFollowing](https://github.com/soham2560/6DOF_ObjectFollowing)**: Implements a 6-DOF object following system using ROS 2 and the `humble-garden` image within a Dev Container. * **[ros2_tutorial_repo](https://github.com/soham2560/ros2_tutorial_repo)**: A basic ROS 2 tutorial repository demonstrating fundamental concepts, configured with the `humble` image within a Dev Container. +* **[Husky Mobile robot](https://github.com/RoboticsIIITH/husky_ws)**: Basic ROS Noetic packages for running the Husky mobile robot on AMD64/x86 device. +* **[P3DX Mobile robot](https://github.com/rtarun1/P3DX-Docker)**: Basic ROS Noetic packages for running the P3DX mobile robot on AMD64/x86 device. ## Contributing