ros2 / rosbag2_bag_v2

rosbag2 plugin for replaying ros1 version2 bag files
Apache License 2.0
24 stars 4 forks source link

Provide a Dockerfile with a minimal installation #49

Open doraemon96 opened 1 year ago

doraemon96 commented 1 year ago

I must not be the only one having issues with making this package work. I've had some success when not building anything and just installing from the APT packages, but had no success when trying to do the same by building the packages myself (I have custom messages I need sourced).

I believe making one or more Dockerfiles with a complete custom installation would be not only a great way to provide the community with a simple installation, but also a great way for anyone having issues to be able to look at the steps on how someone else installed it.

E.g.:

FROM osrf/ros:foxy-desktop

# Use bash instead of sh for executing the commands
SHELL ["/bin/bash", "-c"]

WORKDIR /home

RUN sudo apt-get update && sudo apt-get upgrade -y

# Install ROS1 (Noetic)
RUN sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
RUN sudo apt-get install curl
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
RUN sudo apt-get update && sudo apt-get install -y ros-noetic-desktop
RUN sudo apt-get install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
# RUN sudo rosdep init && rosdep update

RUN sudo apt install -y ros-foxy-rosbag2-bag-v2-plugins

(this one for example wouldn't work for custom message definitions) and then maybe some commands to test that the installation went well:

$ env -i bash --noprofile --norc
# source /opt/ros/noetic/setup.bash
# source /opt/ros/foxy/setup.bash
# ros2 bag info -s rosbag_v2 (complete with some sample bagfile downloadable from the internet...)

I will try to make it work and have something to push, but as of now I haven´t been able to create a working docker by building everything myself.