Newer
Older
turtlebot3_noetic / Dockerfile
FROM tiryoh/ros-desktop-vnc:noetic

ENV DEBCONF_NOWARNINGS=yes
ENV DEBIAN_FRONTEND noninteractive
ENV ROS_PYTHON_VERSION 3
SHELL ["/bin/bash", "-c"]

RUN sed -i 's@archive.ubuntu.com@ftp.jaist.ac.jp/pub/Linux@g' /etc/apt/sources.list

RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-keys F42ED6FBAB17C654 && \
    apt-get update && \
    apt-get upgrade -y && \
    apt-get install --no-install-recommends curl -y && \
    curl -k https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | sudo apt-key add - && \
    apt-get install --no-install-recommends -y \
    build-essential \
    dkms \
    openssh-server \
    ros-noetic-joy ros-noetic-teleop-twist-joy \
    ros-noetic-teleop-twist-keyboard ros-noetic-laser-proc \
    ros-noetic-rgbd-launch ros-noetic-rosserial-arduino \
    ros-noetic-rosserial-python ros-noetic-rosserial-client \
    ros-noetic-rosserial-msgs ros-noetic-amcl ros-noetic-map-server \
    ros-noetic-move-base ros-noetic-urdf ros-noetic-xacro \
    ros-noetic-compressed-image-transport ros-noetic-rqt* ros-noetic-rviz \
    ros-noetic-gmapping ros-noetic-navigation ros-noetic-interactive-markers \
    ros-noetic-multirobot-map-merge \
    ros-noetic-image-transport \
    ros-noetic-cv-bridge \
    ros-noetic-vision-opencv \
    ros-noetic-gazebo-ros \
    ros-noetic-turtlebot3-msgs \
    python3-opencv \
    libopencv-dev \
    ros-noetic-image-proc \
    ros-noetic-robot \
    nano gedit \
    python3-pip \
    python-dev && \
    apt-get -y autoremove && \
    apt-get -y clean && \
    rm -rf /var/lib/apt/lists/* && \
    pip3 install --upgrade pip && \
    pip3 install opencv-contrib-python


RUN mkdir /var/run/sshd && \
    echo 'root:ubuntu' | chpasswd && \
    sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
    sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

EXPOSE 22

RUN mkdir -p /home/ubuntu/catkin_ws/src && \
    /bin/bash -c "source /opt/ros/noetic/setup.bash ; cd /home/ubuntu/catkin_ws/src ; catkin_init_workspace" && \
    /bin/bash -c "source /opt/ros/noetic/setup.bash ; cd /home/ubuntu/catkin_ws && catkin build" && \
    echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc && \
    echo "source /home/ubuntu/catkin_ws/devel/setup.bash" >> ~/.bashrc && \
    echo "export ROS_PACKAGE_PATH=\${ROS_PACKAGE_PATH}:/home/ubuntu/catkin_ws" >> ~/.bashrc && \
    echo "export ROS_WORKSPACE=/home/ubuntu/catkin_ws" >> ~/.bashrc && \
    echo "alias cm='cd ~/catkin_ws;catkin build'" >> ~/.bashrc && \
    echo "alias cs='cd ~/catkin_ws/src'" >> ~/.bashrc && \
    echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc && \
    . ~/.bashrc && \
    cd /home/ubuntu/catkin_ws && \
    catkin build 

RUN cd /home/ubuntu/catkin_ws/src && \
    git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git && \
    git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_autorace_2020.git && \
    git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git && \
    git clone -b noetic-devel https://github.com/ROBOTIS-GIT/DynamixelSDK.git

COPY ./startup.sh /startup.sh
COPY ./scripts /home/ubuntu/scripts
COPY ./src /home/ubuntu/catkin_ws/src

RUN cd /home/ubuntu/catkin_ws && \
    catkin build