Extending/sourcing the ROS install dir in a Dockerfile's build phase
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
Asked by spmaniato on 2016-08-16 15:35:03 UTC
Comments
Your problem is that
RUN source ...
is not persistent? Here I see some suggestions for it.Asked by Dimitri Schachmann on 2016-08-17 04:11:05 UTC
Thanks for the link. Looking at the answers, I'm basically doing this one: http://stackoverflow.com/a/25998432/2653356 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.
Asked by spmaniato on 2016-08-17 16:59:35 UTC
When we added build dockerfiles for MoveIt! we went the other route from stackoverflow link above. :/
See links
https://github.com/davetcoleman/moveit_docker/issues/1
https://github.com/ros-planning/moveit/blob/fd835d142e0571da7bfd4649e6bda8a015a0d8f8/.docker/source/Dockerfile#L27-L29
Asked by ruffsl on 2016-10-15 01:34:00 UTC