Extending/sourcing the ROS install dir in a Dockerfile's build phase

asked 2016-08-16 15:35:03 -0500

spmaniato gravatar image

I'm putting together a Dockerfile that builds some custom ROS packages on top of a ROS Indigo installation in /opt/ros/indigo. How do I source this installation directory such that catkin_tools will know that my custom workspace is extending the ROS Indigo installation?

Here's my hacky attempt, which seems to be working:

RUN /bin/bash -c "source /opt/ros/indigo/setup.bash ;\
                  catkin init ;\
                  catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release ;\
                  catkin build --no-status --no-summary --no-notify"

This results in the following output from catkin init:

Extending:             [env] /opt/ros/indigo

Is there a more elegant way of accomplishing this?

PS. I'm aware of ENTRYPOINT, but that's for when the container is run, not during docker build

edit retag flag offensive close merge delete

Comments

Your problem is that RUN source ... is not persistent? Here I see some suggestions for it.

Dimitri Schachmann gravatar image Dimitri Schachmann  ( 2016-08-17 04:11:05 -0500 )edit

Thanks for the link. Looking at the answers, I'm basically doing this one: http://stackoverflow.com/a/25998432/2... The others seem to have various problems (according to the comments) but I'll take a look. I'll report back if any of them work nicely. Thanks again.

spmaniato gravatar image spmaniato  ( 2016-08-17 16:59:35 -0500 )edit
1

When we added build dockerfiles for MoveIt! we went the other route from stackoverflow link above. :/
See links
https://github.com/davetcoleman/movei...
https://github.com/ros-planning/movei...

ruffsl gravatar image ruffsl  ( 2016-10-15 01:34:00 -0500 )edit