ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Instead of using the source in bash, you can use the dot operator instead, as it's supported in dash (the default shell in ubuntu based images)

https://wiki.ubuntu.com/DashAsBinSh

For example:

RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
    colcon build

https://github.com/ros-planning/navigation2/blob/3bf1f7a93d740c54b4c7ef7fc6dd914175bf46be/Dockerfile#L64-L65

You can also change the default shell in the Dockerfile:

https://docs.docker.com/engine/reference/builder/#shell

but I'd suggest keeping it simple with the dot operator as above.