[ros-users] [Discourse.ros.org] [General] Announcing Official Docker Images for ROS2

Lander Usategui San Juan via Discourse.ros.org ros.discourse at gmail.com
Wed Jan 9 10:36:27 UTC 2019



Hi @ruffsl,

first of all thank you for this!

Minor comment on **Creating a  `Dockerfile`  to build ROS packages**:

This line fails:

>  RUN git -C src clone \
      -b $ROS_DISTRO \
      https://github.com/ros2/demos.git

There is no crystal branch on ros2/demos (at least not yet).

```bash
Cloning into 'demos'...
fatal: Remote branch crystal not found in upstream origin
The command '/bin/sh -c git -C src clone       -b $ROS_DISTRO       https://github.com/ros2/demos.git' returned a non-zero code: 128
```

If you change to master branch works without problems. Like:

```bash
FROM ros:crystal-ros-base

# install ros build tools
RUN apt-get update && apt-get install -y \
      python3-colcon-common-extensions && \
    rm -rf /var/lib/apt/lists/*

# clone ros package repo
ENV ROS_WS /opt/ros_ws
RUN mkdir -p $ROS_WS/src
WORKDIR $ROS_WS
RUN git -C src clone \
      -b master \
      https://github.com/ros2/demos.git

# install ros package dependencies
RUN apt-get update && \
    rosdep update && \
    rosdep install -y \
      --from-paths \
        src/demos/demo_nodes_cpp \
      --ignore-src && \
    rm -rf /var/lib/apt/lists/*

# build ros package source
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
    colcon build \
      --packages-select \
        demo_nodes_cpp \
      --cmake-args \
        -DCMAKE_BUILD_TYPE=Release

# copy ros package install via multi-stage
FROM ros:crystal-ros-core
ENV ROS_WS /opt/ros_ws
COPY --from=0  $ROS_WS/install $ROS_WS/install

# source ros package from entrypoint
RUN sed --in-place --expression \
      '$isource "$ROS_WS/install/setup.bash"' \
      /ros_entrypoint.sh

CMD ["bash"]
```

Regards,

@LanderU





---
[Visit Topic](https://discourse.ros.org/t/announcing-official-docker-images-for-ros2/7381/3) or reply to this email to respond.




More information about the ros-users mailing list