Newer
Older
turtlebot3_foxy / Dockerfile
  1. FROM tiryoh/ros2-desktop-vnc:foxy
  2.  
  3. ENV DEBCONF_NOWARNINGS=yes
  4. ENV DEBIAN_FRONTEND noninteractive
  5. ENV ROS_PYTHON_VERSION 3
  6. SHELL ["/bin/bash", "-c"]
  7.  
  8. RUN sed -i 's@archive.ubuntu.com@ftp.jaist.ac.jp/pub/Linux@g' /etc/apt/sources.list
  9.  
  10. RUN apt-get update && \
  11. apt-get upgrade -y && \
  12. apt-get install --no-install-recommends -y \
  13. build-essential \
  14. dkms wget git \
  15. openssh-server && \
  16. apt-get autoremove -y && \
  17. apt-get -y clean && \
  18. rm -rf /var/lib/apt/lists/*
  19.  
  20. RUN mkdir /var/run/sshd && \
  21. echo 'root:ubuntu' | chpasswd && \
  22. sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
  23. sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
  24.  
  25. EXPOSE 22
  26.  
  27. RUN apt-get update && \
  28. apt-get upgrade -y && \
  29. apt-get install --no-install-recommends -y \
  30. libopencv-dev \
  31. python3-colcon-common-extensions && \
  32. cd /home/ubuntu && \
  33. git clone https://github.com/ROBOTIS-GIT/robotis_tools.git && \
  34. cd robotis_tools && \
  35. chmod 755 ./install_ros2_foxy.sh && \
  36. /bin/bash ./install_ros2_foxy.sh && \
  37. apt-get install --no-install-recommends -y \
  38. ros-foxy-gazebo-ros-pkgs \
  39. ros-foxy-cartographer \
  40. ros-foxy-cartographer-ros \
  41. ros-foxy-navigation2 \
  42. ros-foxy-nav2-bringup \
  43. python3-vcstool \
  44. ros-foxy-dynamixel-sdk \
  45. ros-foxy-turtlebot3* && \
  46. apt-get -y autoremove && \
  47. apt-get -y clean && \
  48. rm -rf /var/lib/apt/lists/*
  49.  
  50. RUN mkdir -p /home/ubuntu/colcon_ws/src && \
  51. echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc && \
  52. echo "source /home/ubuntu/colcon_ws/install/setup.bash" >> ~/.bashrc && \
  53. echo "export ROS_DOMAIN_ID=30 #TURTLEBOT3" >> ~/.bashrc && \
  54. echo "alias cm='cd ~/colcon_ws;colcon build'" >> ~/.bashrc && \
  55. echo "alias cs='cd ~/colcon_ws/src'" >> ~/.bashrc && \
  56. echo "export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:~/colcon_ws/src/turtlebot3_simulations/turtlebot3_gazebo/models" >> ~/.bashrc && \
  57. echo "export TURTLEBOT3_MODEL=burger " >> ~/.bashrc && \
  58. apt-get update && \
  59. apt-get upgrade -y && \
  60. cd /home/ubuntu/colcon_ws/src && \
  61. . /opt/ros/foxy/setup.bash && \
  62. . /home/ubuntu/colcon_ws/install/setup.bash && \
  63. colcon build && \
  64. git clone -b foxy-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git && \
  65. git clone -b ros2-devel https://github.com/ROBOTIS-GIT/turtlebot3_machine_learning.git && \
  66. git clone -b foxy-devel https://github.com/ros-planning/navigation2.git && \
  67. git clone -b foxy-devel https://github.com/SteveMacenski/slam_toolbox.git && \
  68. cd /home/ubuntu/colcon_ws && \
  69. colcon build --symlink-install --parallel-workers 1 && \
  70. apt-get autoremove -y && \
  71. apt-get clean && \
  72. rm -rf /var/lib/apt/lists/*
  73.  
  74. COPY ./scripts /home/ubuntu/scripts
  75. COPY ./startup.sh /startup.sh