How to build using Colcon inside a Dockerfile
I'm trying to use docker to build and run a ROS2 node, however in order for Colcon to build the node as an instruction in the Dockerfile, it must first have ROS2 sourced. It seems though that you cannot source a script in a dockerfile instruction, so is there a way to build a Colcon workspace as part of a dockerfile?
Essentially what I'm trying to do assuming a colcon workspace has been copied to the image is:
RUN /bin/bash -c "source /opt/ros/eloquent/setup.sh" && colcon build
I suggest you add the "Update" as an answer and accept it instead of updating the question.