fetch_gazebo
fetch_gazebo copied to clipboard
[FetchIt!] Dockerfile & Docker Example
I was asked to share a Dockerfile with the example of catkin overlays. Sorry, I did have a small typo in the version which I sent around via email, the sed
command had an extra .
.
Here is how the robots for FetchIt! will be setup with three catkin layers:
- /opt/ros/melodic <- bottom layer, only root user can install packages here
- $HOME/ros/stable/install <- middle layer, contains packages which are not in
ros-melodic-desktop-full
but which you depend on, but which you don't actively develop on. - $HOME/ros/active/src <- your active catkin source space $HOME/ros/active/devel <- your active catkin devel space
FROM osrf/ros:melodic-desktop-full-bionic
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& apt-get install -y -q --no-install-recommends \
python-catkin-tools \
python-rosinstall-generator \
&& . /opt/ros/melodic/setup.sh \
&& rosinstall_generator fetchit_challenge --deps --deps-only --exclude RPP > stable.rosinstall \
&& rosinstall_generator fetchit_challenge --upstream > active.rosinstall \
&& mkdir -p $HOME/ros/stable $HOME/ros/active \
&& wstool init $HOME/ros/stable/src stable.rosinstall \
&& wstool init $HOME/ros/active/src active.rosinstall \
&& cd $HOME/ros/stable \
&& catkin config --init \
&& catkin config --install --extend /opt/ros/melodic \
&& catkin build \
&& cd $HOME/ros/active \
&& catkin config --init \
&& catkin config --extend $HOME/ros/stable/install \
&& catkin build \
&& sed -i 's/\/opt\/ros\/\$ROS_DISTRO/\$HOME\/ros\/active\/devel/' ./ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]