Building ros1_bridge fails in Docker container (Noetic & Foxy) [closed]
I am trying to build ros1_bridge
under Docker with Noetic as the ROS1 distro and Foxy as the ROS2 distro. I have tried many different approaches but none seemed to work, or better, they all ended with the same error (described bellow).
For this post I tried to take similar steps as in here. I am trying to build a Docker image using the following Dockerfile
:
FROM ros:foxy-ros1-bridge
RUN apt-get update \
&& apt-get install -y ssh \
build-essential \
gcc \
g++ \
gdb \
clang \
cmake \
rsync \
nano \
tar \
python3 \
ros-foxy-launch* \
&& apt-get clean
ENTRYPOINT ["/ros_entrypoint.sh"]
WORKDIR "/home/workspace"
CMD /bin/bash
Once the image is build I run the following commands (inside the container):
Clone the repo at the appropriate brench
git clone --single-branch --branch foxy https://github.com/ros2/ros1_bridge src/ros1_bridge
Build everything but the ros1_bridge
colcon build --symlink-install --packages-skip ros1_bridge
Source both environments
source /opt/ros/noetic/setup.bash
source /opt/ros/foxy/setup.bash
and finally
colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure --event-handlers console_direct+
After a bit (almost 20 minutes) the compilation stops with the following error:
[ 98%] Linking CXX shared library libros1_bridge.so
[Processing: ros1_bridge]
[Processing: ros1_bridge]
[Processing: ros1_bridge]
[Processing: ros1_bridge]
[Processing: ros1_bridge]
[Processing: ros1_bridge]
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
make[2]: *** [CMakeFiles/ros1_bridge.dir/build.make:5157: libros1_bridge.so] Error 1
make[2]: *** Deleting file 'libros1_bridge.so'
make[1]: *** [CMakeFiles/Makefile2:260: CMakeFiles/ros1_bridge.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
--- stderr: ros1_bridge
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
make[2]: *** [CMakeFiles/ros1_bridge.dir/build.make:5157: libros1_bridge.so] Error 1
make[2]: *** Deleting file 'libros1_bridge.so'
make[1]: *** [CMakeFiles/Makefile2:260: CMakeFiles/ros1_bridge.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed <<< ros1_bridge [19min 22s, exited with code 2]
Summary: 0 packages finished [19min 22s]
1 package failed: ros1_bridge
1 package had stderr output: ros1_bridge
Since the error is not really descriptive, I don't know how to proceed from here and I need some help. Are there any other flags besides --event-handlers console_direct+
that I can add to colcon
for an even more verbose output?