ROS In Docker Container

ROS (Robot Operating System) - Documentation -

In this example I use docker image of ROS Melodic and a Dockerfile for creating the required docker container. Python3 (python3.7) is also installed in this example.

Please refer for more information on Dockers.

  1. Pull the docker image for ROS Melodic

     docker pull ros:melodic
  2. Creating the Dockerfile

     FROM ros:melodic
     RUN apt-get update && apt-get upgrade -y \
         && apt-get install -y software-properties-common \
         && add-apt-repository ppa:deadsnakes/ppa \
         && apt-get install -y python3.7
     RUN apt-get update && apt-get install -y \
         python-pip \
         python3-pip \
     RUN apt-get install -y \
     RUN apt-get update --fix-missing
     RUN dpkg --configure -a
     RUN apt-get install -f
     RUN apt-get install -y \
         ros-melodic-desktop-full --fix-missing
     RUN apt-get install -y python-catkin-tools
     RUN apt-get install --no-install-recommends --no-install-suggests -y \
         build-essential \
         cmake \    
         python3.7-dev \
         && rm -rf /var/lib/apt/lists/*
     RUN python -m pip install --upgrade pip
     RUN python2 -m pip install --upgrade pip
     RUN python3 -m pip install --upgrade pip
     RUN pip3 install --upgrade pip
     RUN pip3 install --upgrade setuptools
     RUN python3.7 -m pip install --upgrade pip
     RUN python3.7 -m pip install --upgrade setuptools
  3. Now create the docker using this Dockerfile and run 😊 (Refer documentation for more information).