Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What for is this script?

This is the default endpoint for all official library ROS docker images, and simple sources the setup script. This is why you can simply pass ros commands like roslaunch or rosrun in the docker run command.

Note that this endpoint isn't executed at build time, so RUN directives in the Dockerfile that expect the ROS environment to be sourced, e.g. chaining colcon workspaces or running rosdep, will have to source the setup script for that RUN directive. Each RUN directive run's in its own env, asside from the global ENV and ARG the scope over later layers.

Note that if you use docker exec to open a new shell in a ros container, that the default entry-point from the original docker image/file will not sourced automatically like for docker run. So for that, you could source it manually after launch the shell, or add it to the .bashrc for the default user (normally root) in the docker image, if you've passed bash to docker exec.